/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  @endpointMap = {
    'cn-shanghai' = 'config.cn-shanghai.aliyuncs.com',
    'ap-southeast-1' = 'config.ap-southeast-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('config', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ResourceDirectoryFolderNode {
  accountId?: string(name='AccountId'),
  children?: [
    ResourceDirectoryFolderNode
  ](name='Children'),
  displayName?: string(name='DisplayName'),
  folderId?: string(name='FolderId'),
  folderName?: string(name='FolderName'),
  parentFolderId?: string(name='ParentFolderId'),
}

model ActiveAggregateConfigRulesRequest {
  aggregatorId?: string(name='AggregatorId', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.

This parameter is required.', example='ca-a4e5626622af0079****'),
  compliancePackId?: string(name='CompliancePackId', description='The rule ID.', example='cp-fe416457e0d90022****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The error code returned.

*   If the rule is enabled, no error code is returned.
*   If the rule fails to be enabled, an error code is returned. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='cr-5772ba41209e007b****'),
}

model ActiveAggregateConfigRulesResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-5772ba41209e007b****'),
        errorCode?: string(name='ErrorCode', description='The error code.', example='ConfigRuleNotExists'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='false'),
      }
    ](name='OperateRuleItemList', description='The result information about the operation.'),
  }(name='OperateRuleResult', description='The results of the operations.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model ActiveAggregateConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ActiveAggregateConfigRulesResponseBody(name='body'),
}

/**
 * @summary Enables one or more rules in an account group. After a rule is enabled, the rule continues to automatically evaluate resources based on the trigger mechanism.
 *
 * @description Enables one or more rules in an account group. After a rule is enabled, the rule continues to automatically evaluate resources based on the trigger mechanism.
 *
 * @param request ActiveAggregateConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ActiveAggregateConfigRulesResponse
 */
async function activeAggregateConfigRulesWithOptions(request: ActiveAggregateConfigRulesRequest, runtime: Util.RuntimeOptions): ActiveAggregateConfigRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ActiveAggregateConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables one or more rules in an account group. After a rule is enabled, the rule continues to automatically evaluate resources based on the trigger mechanism.
 *
 * @description Enables one or more rules in an account group. After a rule is enabled, the rule continues to automatically evaluate resources based on the trigger mechanism.
 *
 * @param request ActiveAggregateConfigRulesRequest
 * @return ActiveAggregateConfigRulesResponse
 */
async function activeAggregateConfigRules(request: ActiveAggregateConfigRulesRequest): ActiveAggregateConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return activeAggregateConfigRulesWithOptions(request, runtime);
}

model ActiveConfigRulesRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-fe416457e0d90022****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule ID. Separate multiple rule IDs with commas (,).', example='cr-2da35180a8d1008e****,cr-2da35180a8d1008e****'),
}

model ActiveConfigRulesResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-2da35180a8d1008e****'),
        errorCode?: string(name='ErrorCode', description='The error code.

*   If the rule is enabled, no error code is returned.
*   If the rule fails to be enabled, an error code is returned. For more information about error codes, see [Error codes](https://next.api.aliyun.com/document/Config/2020-09-07/errorCode).', example='ConfigRuleStatusNotInActive'),
        success?: boolean(name='Success', description='Indicates whether the rule is enabled. Valid values:

*   true
*   false', example='true'),
      }
    ](name='OperateRuleItemList', description='The returned results.'),
  }(name='OperateRuleResult', description='The returned results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='61C1A88F-D163-40DF-84A6-F200229F37B2'),
}

model ActiveConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ActiveConfigRulesResponseBody(name='body'),
}

/**
 * @summary Enables a rule in Cloud Config. After a rule is enabled, Cloud Config automatically evaluates the compliance of a resource based on the trigger mechanism of the rule.
 *
 * @description ### [](#)Prerequisites
 * The rule is in the `INACTIVE` state.
 *
 * @param request ActiveConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ActiveConfigRulesResponse
 */
async function activeConfigRulesWithOptions(request: ActiveConfigRulesRequest, runtime: Util.RuntimeOptions): ActiveConfigRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ActiveConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables a rule in Cloud Config. After a rule is enabled, Cloud Config automatically evaluates the compliance of a resource based on the trigger mechanism of the rule.
 *
 * @description ### [](#)Prerequisites
 * The rule is in the `INACTIVE` state.
 *
 * @param request ActiveConfigRulesRequest
 * @return ActiveConfigRulesResponse
 */
async function activeConfigRules(request: ActiveConfigRulesRequest): ActiveConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return activeConfigRulesWithOptions(request, runtime);
}

model AttachAggregateConfigRuleToCompliancePackRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-75b4626622af00c3****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-0453626622af0020****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-a124626622af00e7****'),
}

model AttachAggregateConfigRuleToCompliancePackResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-a124626622af00e7****'),
        errorCode?: string(name='ErrorCode', description='The error code.

*   This parameter is empty if the rule is added to the compliance package.
*   An error code is returned if the rule fails to be added to the compliance package. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleNotExists'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
      }
    ](name='OperateRuleItemList', description='The result of the operation to add the rule.'),
  }(name='OperateRuleResult', description='The results of the operations to add one or more rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DE72B7B5-D0EA-15E6-A359-EDECBB9BDFA3'),
}

model AttachAggregateConfigRuleToCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachAggregateConfigRuleToCompliancePackResponseBody(name='body'),
}

/**
 * @summary Adds one or more rules in an account group to a compliance package.
 *
 * @description The sample request in this topic shows you how to add the `cr-6cc4626622af00e7****` rule in the `ca-75b4626622af00c3****` account group to the `cp-5bb1626622af00bd****` compliance package.
 *
 * @param request AttachAggregateConfigRuleToCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachAggregateConfigRuleToCompliancePackResponse
 */
async function attachAggregateConfigRuleToCompliancePackWithOptions(request: AttachAggregateConfigRuleToCompliancePackRequest, runtime: Util.RuntimeOptions): AttachAggregateConfigRuleToCompliancePackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachAggregateConfigRuleToCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds one or more rules in an account group to a compliance package.
 *
 * @description The sample request in this topic shows you how to add the `cr-6cc4626622af00e7****` rule in the `ca-75b4626622af00c3****` account group to the `cp-5bb1626622af00bd****` compliance package.
 *
 * @param request AttachAggregateConfigRuleToCompliancePackRequest
 * @return AttachAggregateConfigRuleToCompliancePackResponse
 */
async function attachAggregateConfigRuleToCompliancePack(request: AttachAggregateConfigRuleToCompliancePackRequest): AttachAggregateConfigRuleToCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachAggregateConfigRuleToCompliancePackWithOptions(request, runtime);
}

model AttachConfigRuleToCompliancePackRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-5bb1626622af00bd****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule ID. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-6cc4626622af00e7****'),
}

model AttachConfigRuleToCompliancePackResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-6cc4626622af00e7****'),
        errorCode?: string(name='ErrorCode', description='The error code returned.

*   This parameter is empty if the rule is added to the compliance package.
*   An error code is returned if the rule fails to be added to the compliance package. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleNotExists'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
      }
    ](name='OperateRuleItemList', description='The result of the operation to add the rule.'),
  }(name='OperateRuleResult', description='The results of the operations to add one or more rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB12A'),
}

model AttachConfigRuleToCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachConfigRuleToCompliancePackResponseBody(name='body'),
}

/**
 * @summary Adds one or more rules to a compliance package.
 *
 * @description This topic provides an example on how to add the `cr-6cc4626622af00e7****` rule to the `cp-5bb1626622af00bd****` compliance package.
 *
 * @param request AttachConfigRuleToCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachConfigRuleToCompliancePackResponse
 */
async function attachConfigRuleToCompliancePackWithOptions(request: AttachConfigRuleToCompliancePackRequest, runtime: Util.RuntimeOptions): AttachConfigRuleToCompliancePackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachConfigRuleToCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds one or more rules to a compliance package.
 *
 * @description This topic provides an example on how to add the `cr-6cc4626622af00e7****` rule to the `cp-5bb1626622af00bd****` compliance package.
 *
 * @param request AttachConfigRuleToCompliancePackRequest
 * @return AttachConfigRuleToCompliancePackResponse
 */
async function attachConfigRuleToCompliancePack(request: AttachConfigRuleToCompliancePackRequest): AttachConfigRuleToCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachConfigRuleToCompliancePackWithOptions(request, runtime);
}

model CopyCompliancePacksRequest {
  desAggregatorIds?: string(name='DesAggregatorIds', description='The IDs of the destination account groups into which the compliance packages are replicated. Separate multiple account group IDs with commas (,).

> If this parameter is left empty, the compliance packages are replicated to the current account group.', example='ca-c73c626622af00f8****'),
  srcAggregatorId?: string(name='SrcAggregatorId', description='The ID of the account group to which the compliance packages belong.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).', example='ca-05e6626622af0050****'),
  srcCompliancePackIds?: string(name='SrcCompliancePackIds', description='The IDs of the compliance packages. Separate multiple compliance package IDs with commas (,).

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-4c02626622af0050****,cp-47c1626622af0050****'),
}

model CopyCompliancePacksResponseBody = {
  copyRulesResult?: boolean(name='CopyRulesResult', description='Indicates whether the compliance packages are replicated. Valid values:

*   true
*   false', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='9E1E69DE-BDED-581E-B559-0C15690901D0'),
}

model CopyCompliancePacksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CopyCompliancePacksResponseBody(name='body'),
}

/**
 * @summary Replicates compliance packages.
 *
 * @param request CopyCompliancePacksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CopyCompliancePacksResponse
 */
async function copyCompliancePacksWithOptions(request: CopyCompliancePacksRequest, runtime: Util.RuntimeOptions): CopyCompliancePacksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.desAggregatorIds)) {
    query['DesAggregatorIds'] = request.desAggregatorIds;
  }
  if (!Util.isUnset(request.srcAggregatorId)) {
    query['SrcAggregatorId'] = request.srcAggregatorId;
  }
  if (!Util.isUnset(request.srcCompliancePackIds)) {
    query['SrcCompliancePackIds'] = request.srcCompliancePackIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CopyCompliancePacks',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Replicates compliance packages.
 *
 * @param request CopyCompliancePacksRequest
 * @return CopyCompliancePacksResponse
 */
async function copyCompliancePacks(request: CopyCompliancePacksRequest): CopyCompliancePacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return copyCompliancePacksWithOptions(request, runtime);
}

model CopyConfigRulesRequest {
  desAggregatorIds?: string(name='DesAggregatorIds', description='The IDs of the destination account groups into which the rules are replicated. Separate multiple account group IDs with commas (,).

> If you leave this parameter empty, the compliance packages are replicated into the same account group.', example='ca-4b4e626622af005d****'),
  srcAggregatorId?: string(name='SrcAggregatorId', description='The ID of the account group to which the rules belong.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).', example='ca-24db626622af0060****'),
  srcConfigRuleIds?: string(name='SrcConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).

This parameter is required.', example='cr-4b57626622af0065****,cr-47c1626622af0050****'),
}

model CopyConfigRulesResponseBody = {
  copyRulesResult?: boolean(name='CopyRulesResult', description='Indicates whether the rules are replicated. Valid values:

*   true
*   false', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='7BD81ECF-3194-5A6B-8719-9FC283167AD4'),
}

model CopyConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CopyConfigRulesResponseBody(name='body'),
}

/**
 * @summary Replicates rules.
 *
 * @param request CopyConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CopyConfigRulesResponse
 */
async function copyConfigRulesWithOptions(request: CopyConfigRulesRequest, runtime: Util.RuntimeOptions): CopyConfigRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.desAggregatorIds)) {
    query['DesAggregatorIds'] = request.desAggregatorIds;
  }
  if (!Util.isUnset(request.srcAggregatorId)) {
    query['SrcAggregatorId'] = request.srcAggregatorId;
  }
  if (!Util.isUnset(request.srcConfigRuleIds)) {
    query['SrcConfigRuleIds'] = request.srcConfigRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CopyConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Replicates rules.
 *
 * @param request CopyConfigRulesRequest
 * @return CopyConfigRulesResponse
 */
async function copyConfigRules(request: CopyConfigRulesRequest): CopyConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return copyConfigRulesWithOptions(request, runtime);
}

model CreateAdvancedSearchFileRequest {
  sql?: string(name='Sql', description='The SQL statement used to query resources.

This parameter is required.', example='SELECT * WHERE ResourceType = \\\\"ACS::ECS::Instance\\\\"'),
}

model CreateAdvancedSearchFileResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D231366D-E2AD-559E-9C29-58FF7F4B1F5D'),
}

model CreateAdvancedSearchFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAdvancedSearchFileResponseBody(name='body'),
}

/**
 * @summary Creates a downloadable resource file for the current Alibaba Cloud account.
 *
 * @param request CreateAdvancedSearchFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAdvancedSearchFileResponse
 */
async function createAdvancedSearchFileWithOptions(request: CreateAdvancedSearchFileRequest, runtime: Util.RuntimeOptions): CreateAdvancedSearchFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sql)) {
    query['Sql'] = request.sql;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAdvancedSearchFile',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a downloadable resource file for the current Alibaba Cloud account.
 *
 * @param request CreateAdvancedSearchFileRequest
 * @return CreateAdvancedSearchFileResponse
 */
async function createAdvancedSearchFile(request: CreateAdvancedSearchFileRequest): CreateAdvancedSearchFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAdvancedSearchFileWithOptions(request, runtime);
}

model CreateAggregateAdvancedSearchFileRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-edd3626622af00b3****'),
  sql?: string(name='Sql', description='The SQL statement used to query resources.

This parameter is required.', example='SELECT * WHERE ResourceType = \\\\"ACS::ECS::Instance\\\\"'),
}

model CreateAggregateAdvancedSearchFileResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5F290373-2BE6-534B-8724-A33F1116958B'),
}

model CreateAggregateAdvancedSearchFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAggregateAdvancedSearchFileResponseBody(name='body'),
}

/**
 * @summary Creates a downloadable resource file for an account group.
 *
 * @description This topic provides an example on how to create a downloadable resource file for an account group whose ID is `ca-edd3626622af00b3****`. The resource file includes all the ECS instances in the account group.
 *
 * @param request CreateAggregateAdvancedSearchFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAggregateAdvancedSearchFileResponse
 */
async function createAggregateAdvancedSearchFileWithOptions(request: CreateAggregateAdvancedSearchFileRequest, runtime: Util.RuntimeOptions): CreateAggregateAdvancedSearchFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.sql)) {
    query['Sql'] = request.sql;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAggregateAdvancedSearchFile',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a downloadable resource file for an account group.
 *
 * @description This topic provides an example on how to create a downloadable resource file for an account group whose ID is `ca-edd3626622af00b3****`. The resource file includes all the ECS instances in the account group.
 *
 * @param request CreateAggregateAdvancedSearchFileRequest
 * @return CreateAggregateAdvancedSearchFileResponse
 */
async function createAggregateAdvancedSearchFile(request: CreateAggregateAdvancedSearchFileRequest): CreateAggregateAdvancedSearchFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAggregateAdvancedSearchFileWithOptions(request, runtime);
}

model CreateAggregateCompliancePackRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.

This parameter is required.', example='test-compliance-pack-name'),
  compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template from which you want to create a compliance package.

For more information about how to obtain the ID of a compliance package template, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='ct-5f26ff4e06a300c4****'),
  configRules?: [ 
    {
      configRuleId?: string(name='ConfigRuleId', description='The rule ID. If you configure this parameter, Cloud Config adds the rule that has the specified ID to the compliance package.

You need to only configure the `ManagedRuleIdentifier` or `ConfigRuleId` parameter. If you configure both parameters, the value of the `ConfigRuleId` parameter takes precedence. For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='cr-e918626622af000f****'),
      configRuleName?: string(name='ConfigRuleName', description='The rule name.', example='eip-bandwidth-limit'),
      configRuleParameters?: [ 
        {
          parameterName?: string(name='ParameterName', description='The name of the input parameter.

You must configure the `ParameterName` and `ParameterValue` parameters or neither of them. If the managed rule has an input parameter but no default value exists, you must configure this parameter. For more information about how to obtain the name of an input parameter for a managed rule, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='bandwidth'),
          parameterValue?: string(name='ParameterValue', description='The value of the input parameter.

You must configure the `ParameterName` and `ParameterValue` parameters or neither of them. If the managed rule has an input parameter but no default value exists, you must configure this parameter. For more information about how to obtain the value of an input parameter for a managed rule, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='10'),
        }
      ](name='ConfigRuleParameters', description='The input parameters of the rule.'),
      description?: string(name='Description', description='The rule description.', example='Test rule description.'),
      managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The identifier of the managed rule. Cloud Config automatically creates a rule based on the identifier of the managed rule and adds the rule to the current compliance package.

You need to only configure the `ManagedRuleIdentifier` or `ConfigRuleId` parameter. If you configure both parameters, the value of the `ConfigRuleId` parameter takes precedence. For more information about how to obtain the identifier of a managed rule, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='eip-bandwidth-limit'),
      riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
    }
  ](name='ConfigRules', description='The rules in the compliance package.

>  You must configure this parameter or the `TemplateContent` parameter.'),
  defaultEnable?: boolean(name='DefaultEnable', description='Specifies whether to enable the rule together with the compliance package. Valid values:

*   true: The system enables the rule together with the compliance package.
*   false: The system does not enable the rule together with the compliance package.', example='false'),
  description?: string(name='Description', description='The description of the compliance package.', example='Test compliance pack descripaiton.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions excluded from the compliance evaluations performed by the compliance package. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups excluded from the compliance evaluations performed by the rule. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='4'),
      tagValue?: string(name='TagValue', description='The tag value.', example='user'),
    }
  ](name='ExcludeTagsScope', description='The tags that are excluded.'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources to which the rule applies. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high
*   2 (default): medium
*   3: low', example='1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag that is added to the resource.

You can add up to 20 tag keys to a resource.', example='key-1'),
      value?: string(name='Value', description='The value of the tag that is added to the resource.

You can add up to 20 tag values to a resource.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
  tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.

>  You must configure the TagValueScope parameter together with the TagKeyScope parameter.', example='test'),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='tagKey1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='tagValue1'),
    }
  ](name='TagsScope', description='The tag scope.'),
  templateContent?: string(name='TemplateContent', description='The information about the template that is used to create the compliance package. You can call the GetAggregateCompliancePack operation to view the details of an existing compliance package. You can also write a compliance package template. For more information, see [Write a compliance package template in a configuration file](https://help.aliyun.com/document_detail/2659733.html).

>  You must configure this parameter or the `TemplateContent` parameter.', example='{ "configRuleTemplates": [ { "configRuleName": "condition-rule-example", "scope": { "complianceResourceTypes": [ "ACS::ECS::Instance" ] }, "description": "", "source": { "owner": "CUSTOM_CONFIGURATION", "identifier": "acs-config-configuration", "sourceDetails": [ { "messageType": "ScheduledNotification", "maximumExecutionFrequency": "Twelve_Hours" }, { "messageType": "ConfigurationItemChangeNotification" } ], "conditions": "{\\\\\\\\"ComplianceConditions\\\\\\\\":\\\\\\\\"{\\\\\\\\\\\\\\\\\\\\"operator\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"and\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"children\\\\\\\\\\\\\\\\\\\\":[{\\\\\\\\\\\\\\\\\\\\"operator\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"GreaterOrEquals\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"featurePath\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"$.Cpu\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"featureSource\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"CONFIGURATION\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"desired\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"2\\\\\\\\\\\\\\\\\\\\"}]}\\\\\\\\"}" }, "inputParameters": {} }, { "configRuleName": "oss-bucket-referer-limit", "scope": { "complianceResourceTypes": [ "ACS::OSS::Bucket" ] }, "description": "If the hotlink protection feature is enabled for the Object Storage Service (OSS) bucket and the Referer is added to a specific whitelist, the evaluation result is compliant.", "source": { "owner": "ALIYUN", "identifier": "oss-bucket-referer-limit", "sourceDetails": [ { "messageType": "ConfigurationItemChangeNotification" } ] }, "inputParameters": { "allowEmptyReferer": "true", "allowReferers": "http://www.aliyun.com" } } ] }'),
}

model CreateAggregateCompliancePackShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.

This parameter is required.', example='test-compliance-pack-name'),
  compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template from which you want to create a compliance package.

For more information about how to obtain the ID of a compliance package template, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='ct-5f26ff4e06a300c4****'),
  configRulesShrink?: string(name='ConfigRules', description='The rules in the compliance package.

>  You must configure this parameter or the `TemplateContent` parameter.'),
  defaultEnable?: boolean(name='DefaultEnable', description='Specifies whether to enable the rule together with the compliance package. Valid values:

*   true: The system enables the rule together with the compliance package.
*   false: The system does not enable the rule together with the compliance package.', example='false'),
  description?: string(name='Description', description='The description of the compliance package.', example='Test compliance pack descripaiton.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions excluded from the compliance evaluations performed by the compliance package. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups excluded from the compliance evaluations performed by the rule. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='4'),
      tagValue?: string(name='TagValue', description='The tag value.', example='user'),
    }
  ](name='ExcludeTagsScope', description='The tags that are excluded.'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources to which the rule applies. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high
*   2 (default): medium
*   3: low', example='1'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
  tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.

>  You must configure the TagValueScope parameter together with the TagKeyScope parameter.', example='test'),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='tagKey1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='tagValue1'),
    }
  ](name='TagsScope', description='The tag scope.'),
  templateContent?: string(name='TemplateContent', description='The information about the template that is used to create the compliance package. You can call the GetAggregateCompliancePack operation to view the details of an existing compliance package. You can also write a compliance package template. For more information, see [Write a compliance package template in a configuration file](https://help.aliyun.com/document_detail/2659733.html).

>  You must configure this parameter or the `TemplateContent` parameter.', example='{ "configRuleTemplates": [ { "configRuleName": "condition-rule-example", "scope": { "complianceResourceTypes": [ "ACS::ECS::Instance" ] }, "description": "", "source": { "owner": "CUSTOM_CONFIGURATION", "identifier": "acs-config-configuration", "sourceDetails": [ { "messageType": "ScheduledNotification", "maximumExecutionFrequency": "Twelve_Hours" }, { "messageType": "ConfigurationItemChangeNotification" } ], "conditions": "{\\\\\\\\"ComplianceConditions\\\\\\\\":\\\\\\\\"{\\\\\\\\\\\\\\\\\\\\"operator\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"and\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"children\\\\\\\\\\\\\\\\\\\\":[{\\\\\\\\\\\\\\\\\\\\"operator\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"GreaterOrEquals\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"featurePath\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"$.Cpu\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"featureSource\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"CONFIGURATION\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"desired\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"2\\\\\\\\\\\\\\\\\\\\"}]}\\\\\\\\"}" }, "inputParameters": {} }, { "configRuleName": "oss-bucket-referer-limit", "scope": { "complianceResourceTypes": [ "ACS::OSS::Bucket" ] }, "description": "If the hotlink protection feature is enabled for the Object Storage Service (OSS) bucket and the Referer is added to a specific whitelist, the evaluation result is compliant.", "source": { "owner": "ALIYUN", "identifier": "oss-bucket-referer-limit", "sourceDetails": [ { "messageType": "ConfigurationItemChangeNotification" } ] }, "inputParameters": { "allowEmptyReferer": "true", "allowReferers": "http://www.aliyun.com" } } ] }'),
}

model CreateAggregateCompliancePackResponseBody = {
  compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='cp-fc56626622af00f9****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CC0CE5EB-E51E-48EB-B4AB-9A9E131ECC0F'),
}

model CreateAggregateCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAggregateCompliancePackResponseBody(name='body'),
}

/**
 * @summary Creates a compliance package for an account group.
 *
 * @description This topic provides an example on how to create a compliance package for the account group `ca-f632626622af0079****` by using the compliance package template `ClassifiedProtectionPreCheck`.
 *
 * @param tmpReq CreateAggregateCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAggregateCompliancePackResponse
 */
async function createAggregateCompliancePackWithOptions(tmpReq: CreateAggregateCompliancePackRequest, runtime: Util.RuntimeOptions): CreateAggregateCompliancePackResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAggregateCompliancePackShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.configRules)) {
    request.configRulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.configRules, 'ConfigRules', 'json');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliancePackName)) {
    body['CompliancePackName'] = request.compliancePackName;
  }
  if (!Util.isUnset(request.compliancePackTemplateId)) {
    body['CompliancePackTemplateId'] = request.compliancePackTemplateId;
  }
  if (!Util.isUnset(request.configRulesShrink)) {
    body['ConfigRules'] = request.configRulesShrink;
  }
  if (!Util.isUnset(request.defaultEnable)) {
    body['DefaultEnable'] = request.defaultEnable;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.excludeRegionIdsScope)) {
    body['ExcludeRegionIdsScope'] = request.excludeRegionIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceGroupIdsScope)) {
    body['ExcludeResourceGroupIdsScope'] = request.excludeResourceGroupIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceIdsScope)) {
    body['ExcludeResourceIdsScope'] = request.excludeResourceIdsScope;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.excludeTagsScope)) {
    bodyFlat['ExcludeTagsScope'] = request.excludeTagsScope;
  }
  if (!Util.isUnset(request.regionIdsScope)) {
    body['RegionIdsScope'] = request.regionIdsScope;
  }
  if (!Util.isUnset(request.resourceGroupIdsScope)) {
    body['ResourceGroupIdsScope'] = request.resourceGroupIdsScope;
  }
  if (!Util.isUnset(request.resourceIdsScope)) {
    body['ResourceIdsScope'] = request.resourceIdsScope;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.tagKeyScope)) {
    body['TagKeyScope'] = request.tagKeyScope;
  }
  if (!Util.isUnset(request.tagValueScope)) {
    body['TagValueScope'] = request.tagValueScope;
  }
  if (!Util.isUnset(request.tagsScope)) {
    bodyFlat['TagsScope'] = request.tagsScope;
  }
  if (!Util.isUnset(request.templateContent)) {
    body['TemplateContent'] = request.templateContent;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAggregateCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a compliance package for an account group.
 *
 * @description This topic provides an example on how to create a compliance package for the account group `ca-f632626622af0079****` by using the compliance package template `ClassifiedProtectionPreCheck`.
 *
 * @param request CreateAggregateCompliancePackRequest
 * @return CreateAggregateCompliancePackResponse
 */
async function createAggregateCompliancePack(request: CreateAggregateCompliancePackRequest): CreateAggregateCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAggregateCompliancePackWithOptions(request, runtime);
}

model CreateAggregateConfigDeliveryChannelRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests.

The `token` can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [Ensure idempotence](https://help.aliyun.com/document_detail/25693.html)', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliantSnapshot?: boolean(name='CompliantSnapshot', description='Specifies whether to deliver scheduled compliant snapshots. Cloud Config delivers scheduled compliant snapshots to Log Service at `04:00Z` and `16:00Z` every day. The time is displayed in UTC. Valid values:

*   true: Cloud Config delivers scheduled compliant snapshots.
*   false: Cloud Config does not deliver scheduled compliant snapshots. This is the default value.', example='false'),
  configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Specifies whether to deliver resource change logs. If you set this parameter to true, Cloud Config delivers resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true: Cloud Config delivers resource change logs.
*   false: Cloud Config does not deliver resource change logs. This is the default value.

> This parameter is available for delivery channels of the OSS, SLS, and MNS types.', example='false'),
  configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Specifies whether to deliver scheduled resource snapshots. Cloud Config delivers scheduled resource snapshots to OSS, MNS, or Log Service at `04:00Z` and `16:00Z` every day. The time is displayed in UTC. Valid values:

*   true: Cloud Config delivers scheduled resource snapshots.
*   false: Cloud Config does not deliver scheduled resource snapshots. This is the default value.', example='false'),
  deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that you want to attach to the delivery channel. This parameter is available when you deliver data of all types to MNS or deliver snapshots to Log Service.

*   If you set the DeliveryChannelType parameter to MNS, take note of the following settings of the lowest risk level and the resource types of the events to which you want to subscribe:

    *   The lowest risk level of the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

        The `value` field indicates the risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

    *   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

        The `values` field indicates the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Example:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`

*   If you set the DeliveryChannelType parameter to SLS, the setting of the resource types of the snapshots to which you want to deliver is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the snapshots to which you want to deliver. The value of the field is a JSON array. Example:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
  deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.

> If you do not configure this parameter, this parameter is left empty.', example='testoss'),
  deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The ARN of the delivery destination. Valid values:

*   `acs:oss:{RegionId}:{accountId}:{bucketName}` if your delivery destination is an OSS bucket. Example: `acs:oss:cn-shanghai:100931896542****:new-bucket`.
*   `acs:mns:{RegionId}:{accountId}:/topics/{topicName}` if your delivery destination is an MNS topic. Example: `acs:mns:cn-shanghai:100931896542****:/topics/topic1`.
*   `acs:log:{RegionId}:{accountId}:project/{projectName}/logstore/{logstoreName}` if your delivery destination is a Log Service Logstore. Example: `acs:log:cn-shanghai:100931896542****:project/project1/logstore/logstore1`.

This parameter is required.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery channel. Valid values:

*   OSS: Object Storage Service (OSS)
*   MNS: Message Service (MNS)
*   SLS: Log Service

This parameter is required.', example='OSS'),
  deliverySnapshotTime?: string(name='DeliverySnapshotTime', description='The time when you want Cloud Config to deliver scheduled resource snapshots every day.

Format: `HH:mmZ`. This time is displayed in UTC.

> When you enable the scheduled resource delivery feature, you can configure this parameter to specify a custom delivery time. If you do not configure this parameter, Cloud Config automatically delivers scheduled resource snapshots at `04:00Z` and `16:00Z` every day.', example='09:10Z'),
  description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
  nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Specifies whether to deliver resource non-compliance events. If you set this parameter to true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are considered non-compliant. Valid values:

*   true: Cloud Config delivers resource non-compliance events.
*   false: Cloud Config does not deliver resource non-compliance events. This is the default value.

> This parameter is available only for delivery channels of the SLS or MNS type.', example='false'),
  oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel. Format: `acs:oss:{RegionId}:{accountId}:{bucketName}`.

If you do not configure this parameter, Cloud Config delivers only summary data.

> This parameter is available only for delivery channels of the SLS or MNS type. The upper limit on the storage size of delivery channels of the SLS type is 1 MB, and the maximum storage size of delivery channels of the MNS type is 64 KB.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
}

model CreateAggregateConfigDeliveryChannelResponseBody = {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-8e45ff4e06a3a8****'),
  requestId?: string(name='RequestId', description='The request ID.', example='A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG'),
}

model CreateAggregateConfigDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAggregateConfigDeliveryChannelResponseBody(name='body'),
}

/**
 * @summary Creates a delivery channel for an account group.
 *
 * @description In this example, a delivery channel is created for an account group. The ID of the account group is `ca-a4e5626622af0079****`. The type of the delivery channel is `OSS` and the Alibaba Cloud Resource Name (ARN) of the delivery destination is `acs:oss:cn-shanghai:100931896542****:new-bucket`. The result indicates that the delivery channel is created. The ID of the delivery channel is `cdc-8e45ff4e06a3a8****`.
 *
 * @param request CreateAggregateConfigDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAggregateConfigDeliveryChannelResponse
 */
async function createAggregateConfigDeliveryChannelWithOptions(request: CreateAggregateConfigDeliveryChannelRequest, runtime: Util.RuntimeOptions): CreateAggregateConfigDeliveryChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliantSnapshot)) {
    query['CompliantSnapshot'] = request.compliantSnapshot;
  }
  if (!Util.isUnset(request.configurationItemChangeNotification)) {
    query['ConfigurationItemChangeNotification'] = request.configurationItemChangeNotification;
  }
  if (!Util.isUnset(request.configurationSnapshot)) {
    query['ConfigurationSnapshot'] = request.configurationSnapshot;
  }
  if (!Util.isUnset(request.deliveryChannelCondition)) {
    query['DeliveryChannelCondition'] = request.deliveryChannelCondition;
  }
  if (!Util.isUnset(request.deliveryChannelName)) {
    query['DeliveryChannelName'] = request.deliveryChannelName;
  }
  if (!Util.isUnset(request.deliveryChannelTargetArn)) {
    query['DeliveryChannelTargetArn'] = request.deliveryChannelTargetArn;
  }
  if (!Util.isUnset(request.deliveryChannelType)) {
    query['DeliveryChannelType'] = request.deliveryChannelType;
  }
  if (!Util.isUnset(request.deliverySnapshotTime)) {
    query['DeliverySnapshotTime'] = request.deliverySnapshotTime;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.nonCompliantNotification)) {
    query['NonCompliantNotification'] = request.nonCompliantNotification;
  }
  if (!Util.isUnset(request.oversizedDataOSSTargetArn)) {
    query['OversizedDataOSSTargetArn'] = request.oversizedDataOSSTargetArn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAggregateConfigDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a delivery channel for an account group.
 *
 * @description In this example, a delivery channel is created for an account group. The ID of the account group is `ca-a4e5626622af0079****`. The type of the delivery channel is `OSS` and the Alibaba Cloud Resource Name (ARN) of the delivery destination is `acs:oss:cn-shanghai:100931896542****:new-bucket`. The result indicates that the delivery channel is created. The ID of the delivery channel is `cdc-8e45ff4e06a3a8****`.
 *
 * @param request CreateAggregateConfigDeliveryChannelRequest
 * @return CreateAggregateConfigDeliveryChannelResponse
 */
async function createAggregateConfigDeliveryChannel(request: CreateAggregateConfigDeliveryChannelRequest): CreateAggregateConfigDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAggregateConfigDeliveryChannelWithOptions(request, runtime);
}

model CreateAggregateConfigRuleRequest {
  accountIdsScope?: string(name='AccountIdsScope', description='The IDs of the member accounts to which the rule applies, which means that the resources within the member accounts are evaluated based on the rule. Separate multiple member account IDs with commas (,).', example='115748125982****'),
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleName?: string(name='ConfigRuleName', description='The rule name.

This parameter is required.', example='oss-default-encryption-kms'),
  configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.

This parameter is required.', example='ConfigurationItemChangeNotification'),
  description?: string(name='Description', description='The description of the rule.', example='description of rule'),
  excludeAccountIdsScope?: string(name='ExcludeAccountIdsScope', description='The ID of the member account to which the rule does not apply, which means that the resources within the member account are not evaluated based on the rule. Separate multiple member account IDs with commas (,).

> This parameter applies only to a managed rule.', example='120886317861****'),
  excludeFolderIdsScope?: string(name='ExcludeFolderIdsScope', description='The ID of the resource directory to which the rule does not apply, which means that the resources within member accounts in the resource directory are not evaluated based on the rule. Separate multiple resource directory IDs with commas (,).

> 

*   This parameter applies only to a rule of a global account group.

*   This parameter applies only to a managed rule.', example='fd-pWmkqZ****'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource to be excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

> This parameter applies only to a managed rule.', example='lb-t4nbowvtbkss7t326****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key of the resource that you want to exclude.', example='key-2'),
      tagValue?: string(name='TagValue', description='The tag value of the resource that you want to exclude.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='The scope of the tag that is excluded.'),
  extendContent?: string(name='ExtendContent', description='The extended content, which is temporarily only used to configure the trigger time with a 24-hour cycle trigger.', example='{"fixedHour":"12"}'),
  folderIdsScope?: string(name='FolderIdsScope', description='The ID of the resource directory to which the rule applies, which means that the resources within member accounts in the resource directory are evaluated based on the rule.

> 

*   This parameter applies only to a rule of a global account group.

*   This parameter applies only to a managed rule.', example='fd-ZtHsRH****'),
  inputParameters?: map[string]any(name='InputParameters', description='The input parameter of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
  maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours (default)

>  This parameter is required if the `ConfigRuleTriggerTypes` parameter is set to `ScheduledNotification`.', example='One_Hour'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region to which the rule applies. Separate multiple region IDs with commas (,).

> This parameter applies only to a managed rule.', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group to which the rule applies. Separate multiple resource group IDs with commas (,).

> This parameter applies only to a managed rule.', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
  resourceTypesScope?: [ string ](name='ResourceTypesScope', description='The type of the resource evaluated by the rule. Separate multiple resource types with commas (,).

This parameter is required.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low

This parameter is required.', example='1'),
  sourceIdentifier?: string(name='SourceIdentifier', description='The identifier of the rule.

*   If you set the SourceOwner parameter to ALIYUN, set this parameter to the name of the managed rule.
*   If you set the SourceOwner parameter to CUSTOM_FC, set this parameter to the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.

For more information about how to query the name of a managed rule, see [Managed rules](https://help.aliyun.com/document_detail/127404.html).

This parameter is required.', example='required-tags'),
  sourceOwner?: string(name='SourceOwner', description='The type of the rule. Valid values:

*   ALIYUN: a managed rule.
*   CUSTOM_FC: a custom rule.

This parameter is required.', example='ALIYUN'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.

You can specify at most 20 tag keys.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags.'),
  tagKeyLogicScope?: string(name='TagKeyLogicScope', description='The logical relationship when parameter `TagsScope` takes multiple values, for example: When the parameter `TagsScope` is `"TagsScope.1.TagKey":"a", "TagsScope.1.TagValue":"a", "TagsScope.2.TagKey":"b", "TagsScope.2.TagValue":"b"`, if this parameter is set to` AND`, it means that the rule only applies to resources bound with both tags `a:a` and `b:b`. If not specified, the default logic is `OR`.

It can also be used for the deprecated field `TagKeyScope` (not recommended), for example: When the parameter `TagKeyScope` has a value of `ECS`,`OSS`, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels `ECS` and `OSS`.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
  tagKeyScope?: string(name='TagKeyScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag key used to filter resources. The rule applies only to the resources with the specified tag key. Separate multiple parameter values with commas (,).

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='ECS', deprecated=true),
  tagValueScope?: string(name='TagValueScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='test', deprecated=true),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
    }
  ](name='TagsScope', description='The tag scope.'),
}

model CreateAggregateConfigRuleShrinkRequest {
  accountIdsScope?: string(name='AccountIdsScope', description='The IDs of the member accounts to which the rule applies, which means that the resources within the member accounts are evaluated based on the rule. Separate multiple member account IDs with commas (,).', example='115748125982****'),
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleName?: string(name='ConfigRuleName', description='The rule name.

This parameter is required.', example='oss-default-encryption-kms'),
  configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.

This parameter is required.', example='ConfigurationItemChangeNotification'),
  description?: string(name='Description', description='The description of the rule.', example='description of rule'),
  excludeAccountIdsScope?: string(name='ExcludeAccountIdsScope', description='The ID of the member account to which the rule does not apply, which means that the resources within the member account are not evaluated based on the rule. Separate multiple member account IDs with commas (,).

> This parameter applies only to a managed rule.', example='120886317861****'),
  excludeFolderIdsScope?: string(name='ExcludeFolderIdsScope', description='The ID of the resource directory to which the rule does not apply, which means that the resources within member accounts in the resource directory are not evaluated based on the rule. Separate multiple resource directory IDs with commas (,).

> 

*   This parameter applies only to a rule of a global account group.

*   This parameter applies only to a managed rule.', example='fd-pWmkqZ****'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource to be excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

> This parameter applies only to a managed rule.', example='lb-t4nbowvtbkss7t326****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key of the resource that you want to exclude.', example='key-2'),
      tagValue?: string(name='TagValue', description='The tag value of the resource that you want to exclude.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='The scope of the tag that is excluded.'),
  extendContent?: string(name='ExtendContent', description='The extended content, which is temporarily only used to configure the trigger time with a 24-hour cycle trigger.', example='{"fixedHour":"12"}'),
  folderIdsScope?: string(name='FolderIdsScope', description='The ID of the resource directory to which the rule applies, which means that the resources within member accounts in the resource directory are evaluated based on the rule.

> 

*   This parameter applies only to a rule of a global account group.

*   This parameter applies only to a managed rule.', example='fd-ZtHsRH****'),
  inputParametersShrink?: string(name='InputParameters', description='The input parameter of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
  maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours (default)

>  This parameter is required if the `ConfigRuleTriggerTypes` parameter is set to `ScheduledNotification`.', example='One_Hour'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region to which the rule applies. Separate multiple region IDs with commas (,).

> This parameter applies only to a managed rule.', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group to which the rule applies. Separate multiple resource group IDs with commas (,).

> This parameter applies only to a managed rule.', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
  resourceTypesScopeShrink?: string(name='ResourceTypesScope', description='The type of the resource evaluated by the rule. Separate multiple resource types with commas (,).

This parameter is required.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low

This parameter is required.', example='1'),
  sourceIdentifier?: string(name='SourceIdentifier', description='The identifier of the rule.

*   If you set the SourceOwner parameter to ALIYUN, set this parameter to the name of the managed rule.
*   If you set the SourceOwner parameter to CUSTOM_FC, set this parameter to the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.

For more information about how to query the name of a managed rule, see [Managed rules](https://help.aliyun.com/document_detail/127404.html).

This parameter is required.', example='required-tags'),
  sourceOwner?: string(name='SourceOwner', description='The type of the rule. Valid values:

*   ALIYUN: a managed rule.
*   CUSTOM_FC: a custom rule.

This parameter is required.', example='ALIYUN'),
  tagShrink?: string(name='Tag', description='The tags.'),
  tagKeyLogicScope?: string(name='TagKeyLogicScope', description='The logical relationship when parameter `TagsScope` takes multiple values, for example: When the parameter `TagsScope` is `"TagsScope.1.TagKey":"a", "TagsScope.1.TagValue":"a", "TagsScope.2.TagKey":"b", "TagsScope.2.TagValue":"b"`, if this parameter is set to` AND`, it means that the rule only applies to resources bound with both tags `a:a` and `b:b`. If not specified, the default logic is `OR`.

It can also be used for the deprecated field `TagKeyScope` (not recommended), for example: When the parameter `TagKeyScope` has a value of `ECS`,`OSS`, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels `ECS` and `OSS`.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
  tagKeyScope?: string(name='TagKeyScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag key used to filter resources. The rule applies only to the resources with the specified tag key. Separate multiple parameter values with commas (,).

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='ECS', deprecated=true),
  tagValueScope?: string(name='TagValueScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='test', deprecated=true),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
    }
  ](name='TagsScope', description='The tag scope.'),
}

model CreateAggregateConfigRuleResponseBody = {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-4e3d626622af0080****'),
  requestId?: string(name='RequestId', description='The request ID.', example='5895065A-196C-4254-8AD8-14EFC31EEF50'),
}

model CreateAggregateConfigRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAggregateConfigRuleResponseBody(name='body'),
}

/**
 * @summary Creates a rule for an account group.
 *
 * @description ### Limits
 * You can create up to 200 rules for each management account.
 * ### Usage notes
 * This topic provides an example on how to create a rule based on the required-tags managed rule in the `ca-a4e5626622af0079****` account group. The returned result shows that the rule is created and its ID is `cr-4e3d626622af0080****`.
 *
 * @param tmpReq CreateAggregateConfigRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAggregateConfigRuleResponse
 */
async function createAggregateConfigRuleWithOptions(tmpReq: CreateAggregateConfigRuleRequest, runtime: Util.RuntimeOptions): CreateAggregateConfigRuleResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAggregateConfigRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.inputParameters)) {
    request.inputParametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.inputParameters, 'InputParameters', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceTypesScope)) {
    request.resourceTypesScopeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceTypesScope, 'ResourceTypesScope', 'simple');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.resourceNameScope)) {
    query['ResourceNameScope'] = request.resourceNameScope;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountIdsScope)) {
    body['AccountIdsScope'] = request.accountIdsScope;
  }
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configRuleName)) {
    body['ConfigRuleName'] = request.configRuleName;
  }
  if (!Util.isUnset(request.configRuleTriggerTypes)) {
    body['ConfigRuleTriggerTypes'] = request.configRuleTriggerTypes;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.excludeAccountIdsScope)) {
    body['ExcludeAccountIdsScope'] = request.excludeAccountIdsScope;
  }
  if (!Util.isUnset(request.excludeFolderIdsScope)) {
    body['ExcludeFolderIdsScope'] = request.excludeFolderIdsScope;
  }
  if (!Util.isUnset(request.excludeRegionIdsScope)) {
    body['ExcludeRegionIdsScope'] = request.excludeRegionIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceGroupIdsScope)) {
    body['ExcludeResourceGroupIdsScope'] = request.excludeResourceGroupIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceIdsScope)) {
    body['ExcludeResourceIdsScope'] = request.excludeResourceIdsScope;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.excludeTagsScope)) {
    bodyFlat['ExcludeTagsScope'] = request.excludeTagsScope;
  }
  if (!Util.isUnset(request.extendContent)) {
    body['ExtendContent'] = request.extendContent;
  }
  if (!Util.isUnset(request.folderIdsScope)) {
    body['FolderIdsScope'] = request.folderIdsScope;
  }
  if (!Util.isUnset(request.inputParametersShrink)) {
    body['InputParameters'] = request.inputParametersShrink;
  }
  if (!Util.isUnset(request.maximumExecutionFrequency)) {
    body['MaximumExecutionFrequency'] = request.maximumExecutionFrequency;
  }
  if (!Util.isUnset(request.regionIdsScope)) {
    body['RegionIdsScope'] = request.regionIdsScope;
  }
  if (!Util.isUnset(request.resourceGroupIdsScope)) {
    body['ResourceGroupIdsScope'] = request.resourceGroupIdsScope;
  }
  if (!Util.isUnset(request.resourceIdsScope)) {
    body['ResourceIdsScope'] = request.resourceIdsScope;
  }
  if (!Util.isUnset(request.resourceTypesScopeShrink)) {
    body['ResourceTypesScope'] = request.resourceTypesScopeShrink;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.sourceIdentifier)) {
    body['SourceIdentifier'] = request.sourceIdentifier;
  }
  if (!Util.isUnset(request.sourceOwner)) {
    body['SourceOwner'] = request.sourceOwner;
  }
  if (!Util.isUnset(request.tagKeyLogicScope)) {
    body['TagKeyLogicScope'] = request.tagKeyLogicScope;
  }
  if (!Util.isUnset(request.tagKeyScope)) {
    body['TagKeyScope'] = request.tagKeyScope;
  }
  if (!Util.isUnset(request.tagValueScope)) {
    body['TagValueScope'] = request.tagValueScope;
  }
  if (!Util.isUnset(request.tagsScope)) {
    bodyFlat['TagsScope'] = request.tagsScope;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAggregateConfigRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a rule for an account group.
 *
 * @description ### Limits
 * You can create up to 200 rules for each management account.
 * ### Usage notes
 * This topic provides an example on how to create a rule based on the required-tags managed rule in the `ca-a4e5626622af0079****` account group. The returned result shows that the rule is created and its ID is `cr-4e3d626622af0080****`.
 *
 * @param request CreateAggregateConfigRuleRequest
 * @return CreateAggregateConfigRuleResponse
 */
async function createAggregateConfigRule(request: CreateAggregateConfigRuleRequest): CreateAggregateConfigRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAggregateConfigRuleWithOptions(request, runtime);
}

model CreateAggregateRemediationRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-6b4a626622af0012****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='AAAAAdDWBF2****'),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-6b7c626622af00b4****'),
  invokeType?: string(name='InvokeType', description='The execution mode of the remediation template. Valid values:

*   NON_EXECUTION: The remediation template is not executed.
*   AUTO_EXECUTION: The remediation template is automatically executed.
*   MANUAL_EXECUTION: The remediation template is manually executed.
*   NOT_CONFIG: The execution mode is not specified.

This parameter is required.', example='MANUAL_EXECUTION'),
  params?: string(name='Params', description='The configuration of the remediation template.

For more information about how to obtain the configuration of the remediation template, see [ListRemediationTemplates](https://help.aliyun.com/document_detail/416781.html). You can view the `TemplateDefinition` response parameter to obtain the configuration of the remediation template.

This parameter is required.', example='{"bucketName": "{resourceId}", "regionId": "{regionId}", "permissionName": "private"}'),
  remediationTemplateId?: string(name='RemediationTemplateId', description='The ID of the remediation template.

*   If you set the `RemediationType` parameter to `OOS`, set this parameter to the identifier of the relevant official remediation template, such as `ACS-OSS-PutBucketAcl`. For more information about how to obtain the remediation template identifier, see [ListRemediationTemplates](https://help.aliyun.com/document_detail/416781.html).
*   If you set the `RemediationType` parameter to `FC`, set this parameter to the Alibaba Cloud Resource Name (ARN) of the relevant Function Compute resource, such as `acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/test-php`.

This parameter is required.', example='ACS-OSS-PutBucketAcl'),
  remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid values:

*   OOS: stands for Operation Orchestration Service and indicates official remediation.
*   FC: stands for Function Compute and indicates custom remediation.

This parameter is required.', example='OOS'),
  sourceType?: string(name='SourceType', description='The source of remediation template. Valid values:

*   ALIYUN (default): official template.
*   CUSTOM: custom template.
*   NONE: none.', example='ALIYUN'),
}

model CreateAggregateRemediationResponseBody = {
  remediationId?: string(name='RemediationId', description='The ID of the remediation template.', example='crr-909ba2d4716700eb****'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}

model CreateAggregateRemediationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAggregateRemediationResponseBody(name='body'),
}

/**
 * @summary Creates a remediation template for a rule in an account group.
 *
 * @description This topic provides an example on how to create a remediation template for the rule whose ID is `cr-6b7c626622af00b4****` in the account group whose ID is `ca-6b4a626622af0012****`. The returned result shows that a remediation template is created and the ID of the remediation template is `crr-909ba2d4716700eb****`.
 *
 * @param request CreateAggregateRemediationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAggregateRemediationResponse
 */
async function createAggregateRemediationWithOptions(request: CreateAggregateRemediationRequest, runtime: Util.RuntimeOptions): CreateAggregateRemediationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configRuleId)) {
    body['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.invokeType)) {
    body['InvokeType'] = request.invokeType;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }
  if (!Util.isUnset(request.remediationTemplateId)) {
    body['RemediationTemplateId'] = request.remediationTemplateId;
  }
  if (!Util.isUnset(request.remediationType)) {
    body['RemediationType'] = request.remediationType;
  }
  if (!Util.isUnset(request.sourceType)) {
    body['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAggregateRemediation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a remediation template for a rule in an account group.
 *
 * @description This topic provides an example on how to create a remediation template for the rule whose ID is `cr-6b7c626622af00b4****` in the account group whose ID is `ca-6b4a626622af0012****`. The returned result shows that a remediation template is created and the ID of the remediation template is `crr-909ba2d4716700eb****`.
 *
 * @param request CreateAggregateRemediationRequest
 * @return CreateAggregateRemediationResponse
 */
async function createAggregateRemediation(request: CreateAggregateRemediationRequest): CreateAggregateRemediationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAggregateRemediationWithOptions(request, runtime);
}

model CreateAggregatorRequest {
  aggregatorAccounts?: [ 
    {
      accountId?: long(name='AccountId', description='The member account ID. For more information about how to obtain the ID of a member account, see [ListAccounts](https://help.aliyun.com/document_detail/160016.html).', example='171322098523****'),
      accountName?: string(name='AccountName', description='The name of the member account. For more information about how to obtain the name of a member account, see [ListAccounts](https://help.aliyun.com/document_detail/160016.html).', example='Alice'),
      accountType?: string(name='AccountType', description='The type of the member account. Set this parameter to ResourceDirectory.', example='ResourceDirectory'),
    }
  ](name='AggregatorAccounts', description='The information about the member accounts in the account group. Example:

    [{
    	"accountId": 171322098523****,
    	"accountType":"ResourceDirectory",
                    "accountName":"Alice"
    }, {
    	"accountId": 100532098349****,
    	"accountType":"ResourceDirectory",
                    "accountName":"Tom"
    }]

>  If `AggregatorType` is set to `RD` or `FOLDER`, this parameter can be left empty, which indicates that all accounts in the resource directory are added to the global account group.', nullable=false),
  aggregatorName?: string(name='AggregatorName', description='The name of the account group.

This parameter is required.', example='Test_Group'),
  aggregatorType?: string(name='AggregatorType', description='The type of the account group. Valid values:

*   RD: global account group.
*   FOLDER: account group of the folder.
*   CUSTOM (default): custom account group.', example='CUSTOM'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  description?: string(name='Description', description='The description of the account group.

This parameter is required.', example='Aggregator description.'),
  folderId?: string(name='FolderId', description='The ID of the folder to which the account group is attached. You must specify this parameter if `AggregatorType` is set to `FOLDER`. Multiple resource folder IDs should be separated by commas (,).', example='fd-brHdgv****,fd-brHdgk****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model CreateAggregatorShrinkRequest {
  aggregatorAccountsShrink?: string(name='AggregatorAccounts', description='The information about the member accounts in the account group. Example:

    [{
    	"accountId": 171322098523****,
    	"accountType":"ResourceDirectory",
                    "accountName":"Alice"
    }, {
    	"accountId": 100532098349****,
    	"accountType":"ResourceDirectory",
                    "accountName":"Tom"
    }]

>  If `AggregatorType` is set to `RD` or `FOLDER`, this parameter can be left empty, which indicates that all accounts in the resource directory are added to the global account group.', nullable=false),
  aggregatorName?: string(name='AggregatorName', description='The name of the account group.

This parameter is required.', example='Test_Group'),
  aggregatorType?: string(name='AggregatorType', description='The type of the account group. Valid values:

*   RD: global account group.
*   FOLDER: account group of the folder.
*   CUSTOM (default): custom account group.', example='CUSTOM'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  description?: string(name='Description', description='The description of the account group.

This parameter is required.', example='Aggregator description.'),
  folderId?: string(name='FolderId', description='The ID of the folder to which the account group is attached. You must specify this parameter if `AggregatorType` is set to `FOLDER`. Multiple resource folder IDs should be separated by commas (,).', example='fd-brHdgv****,fd-brHdgk****'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model CreateAggregatorResponseBody = {
  aggregatorId?: string(name='AggregatorId', description='The account group ID.', example='ca-dacf86d8314e00eb****'),
  requestId?: string(name='RequestId', description='The request ID.', example='8195B664-9565-4685-89AC-8B5F04B44B92'),
}

model CreateAggregatorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAggregatorResponseBody(name='body'),
}

/**
 * @summary Creates an account group.
 *
 * @description Each management account can create a maximum of five account groups. Each account group can contain a maximum of 200 member accounts.
 * Cloud Config supports the following types of account groups:
 * *   Global account group: The global account group contains all the member accounts that are added to the resource directory. A management account can create only one global account group.
 * *   Custom account group: If you create a custom account group, you must manually add all or specific member accounts from the resource directory to the custom account group.
 * This topic provides an example on how to create an account group of the `CUSTOM` type. The custom account group is named `Test_Group`, and its description is `Test account group`. The custom account group contains the following two member accounts:
 * *   Member account ID: `171322098523****`. Member account name: `Alice`.
 * *   Member account ID: `100532098349****`. Member account name: `Tom`.
 *
 * @param tmpReq CreateAggregatorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAggregatorResponse
 */
async function createAggregatorWithOptions(tmpReq: CreateAggregatorRequest, runtime: Util.RuntimeOptions): CreateAggregatorResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAggregatorShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.aggregatorAccounts)) {
    request.aggregatorAccountsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.aggregatorAccounts, 'AggregatorAccounts', 'json');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorAccountsShrink)) {
    body['AggregatorAccounts'] = request.aggregatorAccountsShrink;
  }
  if (!Util.isUnset(request.aggregatorName)) {
    body['AggregatorName'] = request.aggregatorName;
  }
  if (!Util.isUnset(request.aggregatorType)) {
    body['AggregatorType'] = request.aggregatorType;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.folderId)) {
    body['FolderId'] = request.folderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAggregator',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an account group.
 *
 * @description Each management account can create a maximum of five account groups. Each account group can contain a maximum of 200 member accounts.
 * Cloud Config supports the following types of account groups:
 * *   Global account group: The global account group contains all the member accounts that are added to the resource directory. A management account can create only one global account group.
 * *   Custom account group: If you create a custom account group, you must manually add all or specific member accounts from the resource directory to the custom account group.
 * This topic provides an example on how to create an account group of the `CUSTOM` type. The custom account group is named `Test_Group`, and its description is `Test account group`. The custom account group contains the following two member accounts:
 * *   Member account ID: `171322098523****`. Member account name: `Alice`.
 * *   Member account ID: `100532098349****`. Member account name: `Tom`.
 *
 * @param request CreateAggregatorRequest
 * @return CreateAggregatorResponse
 */
async function createAggregator(request: CreateAggregatorRequest): CreateAggregatorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAggregatorWithOptions(request, runtime);
}

model CreateCompliancePackRequest {
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.

This parameter is required.', example='test-pack-name'),
  compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template.

You can call the [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html) operation to obtain the ID of the compliance package.', example='ct-5f26ff4e06a300c4****'),
  configRules?: [ 
    {
      configRuleId?: string(name='ConfigRuleId', description='The rule ID. If you specify this parameter, Cloud Config adds the rule that has the specified ID to the compliance package.

You need to only specify `ManagedRuleIdentifier` or `ConfigRuleId`. If you specify both parameters, Cloud Config adds a rule based on the value of `ConfigRuleId`. You can call the [ListConfigRules](https://help.aliyun.com/document_detail/169607.html) operation to obtain the rule ID.', example='cr-e918626622af000f****'),
      configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='eip-bandwidth-limit'),
      configRuleParameters?: [ 
        {
          parameterName?: string(name='ParameterName', description='The name of the input parameter.

You must specify both `ParameterName` and `ParameterValue` or neither of them. If the managed rule has an input parameter but no default value is specified, you must specify this parameter. You can call the [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html) operation to obtain the names of input parameters of the managed rule.', example='bandwidth'),
          parameterValue?: string(name='ParameterValue', description='The value of the input parameter.

You must specify both `ParameterName` and `ParameterValue` or neither of them. If the managed rule has an input parameter but no default value is specified, you must specify this parameter. You can call the [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html) operation to obtain the values of input parameters of the managed rule.', example='10'),
        }
      ](name='ConfigRuleParameters', description='The input parameters of the rule.'),
      description?: string(name='Description', description='The description of the rule.', example='The description of the test rule.'),
      managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The identifier of the managed rule. Cloud Config automatically creates a managed rule based on the specified identifier and adds the rule to the compliance package.

You need to only specify `ManagedRuleIdentifier` or `ConfigRuleId`. If you specify both parameters, Cloud Config adds a rule based on the value of `ConfigRuleId`. You can call the [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html) operation to obtain the identifier of the managed rule.', example='eip-bandwidth-limit'),
      riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high.
*   2: medium.
*   3: low.', example='1'),
    }
  ](name='ConfigRules', description='The rules in the compliance package. You must specify either this parameter or TemplateContent.', nullable=false),
  defaultEnable?: boolean(name='DefaultEnable', description='Specifies whether to enable the rule together with the compliance package. Valid values:

*   true: The system enables the rule together with the compliance package.
*   false: The system does not enable the rule together with the compliance package.', example='false'),
  description?: string(name='Description', description='The description of the compliance package.', example='Test pack description.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='ExcludeRegionIdsScope', example='cn-hangzhou'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='TagKey', example='key-2'),
      tagValue?: string(name='TagValue', description='TagValue', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzdibsjjc****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='ResourceIdsScope', example='eip-8vbf3x310fn56ijfd****'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Default value: 2. Valid values:

*   1: high.
*   2: medium.
*   3: low.', example='1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag keys.

The tag keys cannot be an empty string. The tag keys can be up to 64 characters in length. The tag keys cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

You can specify at most 20 tag keys in each call.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
  tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.

>  You must configure the TagValueScope parameter together with the TagKeyScope parameter.', example='test'),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='Tagkey', example='key-1'),
      tagValue?: string(name='TagValue', description='TagValue', example='value-1'),
    }
  ](name='TagsScope', description='TagsScope'),
  templateContent?: string(name='TemplateContent', description='The information about the template that is used to generate the compliance package. You can call an API operation to view the details of an existing compliance package or write a compliance package template. For more information, see [Write a compliance package template in a configuration file](https://help.aliyun.com/document_detail/2659733.html). You must specify one of ConfigRules and TemplateContent.', example='{ "configRuleTemplates": [ { "configRuleName": "condition-rule-example", "scope": { "complianceResourceTypes": [ "ACS::ECS::Instance" ] }, "description": "", "source": { "owner": "CUSTOM_CONFIGURATION", "identifier": "acs-config-configuration", "sourceDetails": [ { "messageType": "ScheduledNotification", "maximumExecutionFrequency": "Twelve_Hours" }, { "messageType": "ConfigurationItemChangeNotification" } ], "conditions": "{\\\\\\\\"ComplianceConditions\\\\\\\\":\\\\\\\\"{\\\\\\\\\\\\\\\\\\\\"operator\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"and\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"children\\\\\\\\\\\\\\\\\\\\":[{\\\\\\\\\\\\\\\\\\\\"operator\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"GreaterOrEquals\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"featurePath\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"$.Cpu\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"featureSource\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"CONFIGURATION\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"desired\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"2\\\\\\\\\\\\\\\\\\\\"}]}\\\\\\\\"}" }, "inputParameters": {} }, { "configRuleName": "oss-bucket-referer-limit", "scope": { "complianceResourceTypes": [ "ACS::OSS::Bucket" ] }, "description": "If the hotlink protection feature is enabled for the Object Storage Service (OSS) bucket and the Referer is added to a specific whitelist, the evaluation result is compliant.", "source": { "owner": "ALIYUN", "identifier": "oss-bucket-referer-limit", "sourceDetails": [ { "messageType": "ConfigurationItemChangeNotification" } ] }, "inputParameters": { "allowEmptyReferer": "true", "allowReferers": "http://www.aliyun.com" } } ] }'),
}

model CreateCompliancePackShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.

This parameter is required.', example='test-pack-name'),
  compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template.

You can call the [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html) operation to obtain the ID of the compliance package.', example='ct-5f26ff4e06a300c4****'),
  configRulesShrink?: string(name='ConfigRules', description='The rules in the compliance package. You must specify either this parameter or TemplateContent.', nullable=false),
  defaultEnable?: boolean(name='DefaultEnable', description='Specifies whether to enable the rule together with the compliance package. Valid values:

*   true: The system enables the rule together with the compliance package.
*   false: The system does not enable the rule together with the compliance package.', example='false'),
  description?: string(name='Description', description='The description of the compliance package.', example='Test pack description.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='ExcludeRegionIdsScope', example='cn-hangzhou'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='TagKey', example='key-2'),
      tagValue?: string(name='TagValue', description='TagValue', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzdibsjjc****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='ResourceIdsScope', example='eip-8vbf3x310fn56ijfd****'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Default value: 2. Valid values:

*   1: high.
*   2: medium.
*   3: low.', example='1'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
  tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.

>  You must configure the TagValueScope parameter together with the TagKeyScope parameter.', example='test'),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='Tagkey', example='key-1'),
      tagValue?: string(name='TagValue', description='TagValue', example='value-1'),
    }
  ](name='TagsScope', description='TagsScope'),
  templateContent?: string(name='TemplateContent', description='The information about the template that is used to generate the compliance package. You can call an API operation to view the details of an existing compliance package or write a compliance package template. For more information, see [Write a compliance package template in a configuration file](https://help.aliyun.com/document_detail/2659733.html). You must specify one of ConfigRules and TemplateContent.', example='{ "configRuleTemplates": [ { "configRuleName": "condition-rule-example", "scope": { "complianceResourceTypes": [ "ACS::ECS::Instance" ] }, "description": "", "source": { "owner": "CUSTOM_CONFIGURATION", "identifier": "acs-config-configuration", "sourceDetails": [ { "messageType": "ScheduledNotification", "maximumExecutionFrequency": "Twelve_Hours" }, { "messageType": "ConfigurationItemChangeNotification" } ], "conditions": "{\\\\\\\\"ComplianceConditions\\\\\\\\":\\\\\\\\"{\\\\\\\\\\\\\\\\\\\\"operator\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"and\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"children\\\\\\\\\\\\\\\\\\\\":[{\\\\\\\\\\\\\\\\\\\\"operator\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"GreaterOrEquals\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"featurePath\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"$.Cpu\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"featureSource\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"CONFIGURATION\\\\\\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\\\\\\"desired\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\"2\\\\\\\\\\\\\\\\\\\\"}]}\\\\\\\\"}" }, "inputParameters": {} }, { "configRuleName": "oss-bucket-referer-limit", "scope": { "complianceResourceTypes": [ "ACS::OSS::Bucket" ] }, "description": "If the hotlink protection feature is enabled for the Object Storage Service (OSS) bucket and the Referer is added to a specific whitelist, the evaluation result is compliant.", "source": { "owner": "ALIYUN", "identifier": "oss-bucket-referer-limit", "sourceDetails": [ { "messageType": "ConfigurationItemChangeNotification" } ] }, "inputParameters": { "allowEmptyReferer": "true", "allowReferers": "http://www.aliyun.com" } } ] }'),
}

model CreateCompliancePackResponseBody = {
  compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='cp-a8a8626622af0082****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model CreateCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCompliancePackResponseBody(name='body'),
}

/**
 * @summary Creates a compliance package for the current account.
 *
 * @description Each ordinary account can create up to five compliance packages.
 * This topic provides an example on how to create a compliance package named ClassifiedProtectionPreCheck. The compliance package contains a managed rule named `eip-bandwidth-limit`.
 *
 * @param tmpReq CreateCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCompliancePackResponse
 */
async function createCompliancePackWithOptions(tmpReq: CreateCompliancePackRequest, runtime: Util.RuntimeOptions): CreateCompliancePackResponse {
  Util.validateModel(tmpReq);
  var request = new CreateCompliancePackShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.configRules)) {
    request.configRulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.configRules, 'ConfigRules', 'json');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliancePackName)) {
    body['CompliancePackName'] = request.compliancePackName;
  }
  if (!Util.isUnset(request.compliancePackTemplateId)) {
    body['CompliancePackTemplateId'] = request.compliancePackTemplateId;
  }
  if (!Util.isUnset(request.configRulesShrink)) {
    body['ConfigRules'] = request.configRulesShrink;
  }
  if (!Util.isUnset(request.defaultEnable)) {
    body['DefaultEnable'] = request.defaultEnable;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.excludeRegionIdsScope)) {
    body['ExcludeRegionIdsScope'] = request.excludeRegionIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceGroupIdsScope)) {
    body['ExcludeResourceGroupIdsScope'] = request.excludeResourceGroupIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceIdsScope)) {
    body['ExcludeResourceIdsScope'] = request.excludeResourceIdsScope;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.excludeTagsScope)) {
    bodyFlat['ExcludeTagsScope'] = request.excludeTagsScope;
  }
  if (!Util.isUnset(request.regionIdsScope)) {
    body['RegionIdsScope'] = request.regionIdsScope;
  }
  if (!Util.isUnset(request.resourceGroupIdsScope)) {
    body['ResourceGroupIdsScope'] = request.resourceGroupIdsScope;
  }
  if (!Util.isUnset(request.resourceIdsScope)) {
    body['ResourceIdsScope'] = request.resourceIdsScope;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.tagKeyScope)) {
    body['TagKeyScope'] = request.tagKeyScope;
  }
  if (!Util.isUnset(request.tagValueScope)) {
    body['TagValueScope'] = request.tagValueScope;
  }
  if (!Util.isUnset(request.tagsScope)) {
    bodyFlat['TagsScope'] = request.tagsScope;
  }
  if (!Util.isUnset(request.templateContent)) {
    body['TemplateContent'] = request.templateContent;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a compliance package for the current account.
 *
 * @description Each ordinary account can create up to five compliance packages.
 * This topic provides an example on how to create a compliance package named ClassifiedProtectionPreCheck. The compliance package contains a managed rule named `eip-bandwidth-limit`.
 *
 * @param request CreateCompliancePackRequest
 * @return CreateCompliancePackResponse
 */
async function createCompliancePack(request: CreateCompliancePackRequest): CreateCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCompliancePackWithOptions(request, runtime);
}

model CreateConfigDeliveryChannelRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must ensure that the token is unique among different requests.

The `token` can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [How to ensure idempotence](https://help.aliyun.com/document_detail/25693.html).', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliantSnapshot?: boolean(name='CompliantSnapshot', description='Specifies whether to deliver scheduled compliant snapshots. Cloud Config delivers scheduled compliant snapshots at `04:00Z` and `16:00Z` to Log Service every day. The time is displayed in UTC. Valid values:

*   true: Cloud Config delivers scheduled compliant snapshots.
*   false (default): Cloud Config does not deliver scheduled compliant snapshots.', example='false'),
  configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Specifies whether to deliver resource change logs. If you set this parameter to true, Cloud Config delivers resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true: Cloud Config delivers resource change logs.
*   false (default): Cloud Config does not deliver resource change logs.

> This parameter is available for delivery channels of the OSS, SLS, and MNS types.', example='false'),
  configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Specifies whether to deliver scheduled resource snapshots. Cloud Config delivers scheduled resource snapshots at `04:00Z` and `16:00Z` to OSS, MNS, or Log Service every day. The time is displayed in UTC. Valid values:

*   true: Cloud Config delivers scheduled resource snapshots.
*   false (default): Cloud Config does not deliver scheduled resource snapshots.', example='false'),
  deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that you want to attach to the delivery channel, used to specify subscription content filtering conditions.

*   If you specify the minimum risk level and resource types for compliance events, it should be as follows:

    *   The setting of the lowest risk level for the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

        The `value` field indicates the lowest risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

        The `multiple` field indicates whether multiple values are supported for this group of filters. Risk levels only support single-value filtering, so the multiple field for compliance event type content can only be set to `false`.

    *   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

        The `values` field indicates the resource types of the events to which you want to subscribe. 

        The `multiple` field indicates whether multiple values are supported for this group of filters. Resource types support multi-value filtering; when selecting multiple resource types, the multiple field can be set to true.
The value of the field is a JSON array. Examples:

        `[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`

    *   You can also simultaneously specify both risk levels and resource types, such as:

        `[{"filterType":"RuleRiskLevel","value":"2","multiple":false},{"filterType":"ResourceType","values":["ACS::CDN::Domain","ACS::ActionTrail::Trail"],"multiple":true}]`

*   If you specify the resource types for delivering configurations, the resource types are specified by: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the snapshots to which you want to deliver. The value of the field is a JSON array. Examples:

      `[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
  deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.

> If you do not configure this parameter, this parameter is left empty.', example='testoss'),
  deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The Alibaba Cloud Resource Name (ARN) of the delivery destination. Valid values:

*   `acs:oss:{RegionId}:{accountId}:{bucketName}` if your delivery destination is an OSS bucket. Example: `acs:oss:cn-shanghai:100931896542****:new-bucket`.
*   `acs:mns:{RegionId}:{accountId}:/topics/{topicName}` if your delivery destination is an MNS topic. Example: `acs:mns:cn-shanghai:100931896542****:/topics/topic1`.
*   `acs:log:{RegionId}:{accountId}:project/{projectName}/logstore/{logstoreName}` if your delivery destination is a Log Service Logstore. Example: `acs:log:cn-shanghai:100931896542****:project/project1/logstore/logstore1`.

This parameter is required.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery channel. Valid values:

*   OSS: Object Storage Service (OSS)
*   MNS: Message Service (MNS)
*   SLS: Log Service

This parameter is required.', example='OSS'),
  deliverySnapshotTime?: string(name='DeliverySnapshotTime', description='The time when you want Cloud Config to deliver scheduled resource snapshots every day.

Format: `HH:mmZ`. This time is displayed in UTC.

> When you enable the scheduled resource delivery feature, you can configure this parameter to specify a custom delivery time. If you do not configure this parameter, Cloud Config automatically delivers scheduled resource snapshots at `04:00Z` and `16:00Z` every day.', example='09:10Z'),
  description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
  nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Specifies whether to deliver resource non-compliance events. If you set this parameter to true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are considered non-compliant. Valid values:

*   true: Cloud Config delivers resource non-compliance events.
*   false (default): Cloud Config does not deliver resource non-compliance events.

> This parameter is available only for delivery channels of the SLS or MNS type.', example='false'),
  oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel. Format: `acs:oss:{RegionId}:{accountId}:{bucketName}`.

If you do not configure this parameter, Cloud Config delivers only summary data.

> This parameter is available only for delivery channels of the SLS or MNS type. The maximum storage size of delivery channels of the SLS type is 1 MB, and the maximum storage size of delivery channels of the MNS type is 64 KB.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
}

model CreateConfigDeliveryChannelResponseBody = {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-8e45ff4e06a3a8****'),
  requestId?: string(name='RequestId', description='The request ID.', example='A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG'),
}

model CreateConfigDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateConfigDeliveryChannelResponseBody(name='body'),
}

/**
 * @summary Creates a delivery channel.
 *
 * @description In this example, a delivery channel is created. The type of the delivery channel is `OSS` and the Alibaba Cloud Resource Name (ARN) of the delivery destination is `acs:oss:cn-shanghai:100931896542****:new-bucket`. The result indicates that the delivery channel is created, and the ID of the delivery channel is `cdc-8e45ff4e06a3a8****`.
 *
 * @param request CreateConfigDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateConfigDeliveryChannelResponse
 */
async function createConfigDeliveryChannelWithOptions(request: CreateConfigDeliveryChannelRequest, runtime: Util.RuntimeOptions): CreateConfigDeliveryChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliantSnapshot)) {
    query['CompliantSnapshot'] = request.compliantSnapshot;
  }
  if (!Util.isUnset(request.configurationItemChangeNotification)) {
    query['ConfigurationItemChangeNotification'] = request.configurationItemChangeNotification;
  }
  if (!Util.isUnset(request.configurationSnapshot)) {
    query['ConfigurationSnapshot'] = request.configurationSnapshot;
  }
  if (!Util.isUnset(request.deliveryChannelCondition)) {
    query['DeliveryChannelCondition'] = request.deliveryChannelCondition;
  }
  if (!Util.isUnset(request.deliveryChannelName)) {
    query['DeliveryChannelName'] = request.deliveryChannelName;
  }
  if (!Util.isUnset(request.deliveryChannelTargetArn)) {
    query['DeliveryChannelTargetArn'] = request.deliveryChannelTargetArn;
  }
  if (!Util.isUnset(request.deliveryChannelType)) {
    query['DeliveryChannelType'] = request.deliveryChannelType;
  }
  if (!Util.isUnset(request.deliverySnapshotTime)) {
    query['DeliverySnapshotTime'] = request.deliverySnapshotTime;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.nonCompliantNotification)) {
    query['NonCompliantNotification'] = request.nonCompliantNotification;
  }
  if (!Util.isUnset(request.oversizedDataOSSTargetArn)) {
    query['OversizedDataOSSTargetArn'] = request.oversizedDataOSSTargetArn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateConfigDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a delivery channel.
 *
 * @description In this example, a delivery channel is created. The type of the delivery channel is `OSS` and the Alibaba Cloud Resource Name (ARN) of the delivery destination is `acs:oss:cn-shanghai:100931896542****:new-bucket`. The result indicates that the delivery channel is created, and the ID of the delivery channel is `cdc-8e45ff4e06a3a8****`.
 *
 * @param request CreateConfigDeliveryChannelRequest
 * @return CreateConfigDeliveryChannelResponse
 */
async function createConfigDeliveryChannel(request: CreateConfigDeliveryChannelRequest): CreateConfigDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return createConfigDeliveryChannelWithOptions(request, runtime);
}

model CreateConfigRuleRequest {
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.

This parameter is required.', example='required-tags'),
  configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.

>  If a rule supports the preceding trigger types, separate the types with a comma (,).

This parameter is required.', example='ConfigurationItemChangeNotification'),
  description?: string(name='Description', description='The description of the rule.', example='example-description'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='ExcludeRegionIdsScope', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource to be excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

>  This parameter applies only to managed rules.', example='lb-t4nbowvtbkss7t326****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='TagKey', example='key-2'),
      tagValue?: string(name='TagValue', description='TagValue', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
  extendContent?: string(name='ExtendContent', description='Optional field, only used in conjunction with the 24-hour cycle execution to set the trigger time.', example='{"fixedHour":"13"}'),
  inputParameters?: map[string]any(name='InputParameters', description='The input parameter of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
  maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The intervals at which the rule is triggered. Valid values:

*   One_Hour: 1 hour.
*   Three_Hours: 3 hours.
*   Six_Hours: 6 hours.
*   Twelve_Hours: 12 hours.
*   TwentyFour_Hours (default): 24 hours.

>  This parameter is required if the ConfigRuleTriggerTypes parameter is set to ScheduledNotification.', example='One_Hour'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region to which the rule applies. Separate multiple region IDs with commas (,).

>  This parameter applies only to managed rules.', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group to which the rule applies. Separate multiple resource group IDs with commas (,).

>  This parameter applies only to managed rules.', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='ResourceIdsScope', example='lb-5cmbowstbkss9ta03****'),
  resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
  resourceTypesScope?: [ string ](name='ResourceTypesScope', description='The type of the resource to be evaluated by the rule. Separate multiple resource types with commas (,).

This parameter is required.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high.
*   2: medium.
*   3: low.

This parameter is required.', example='1'),
  sourceIdentifier?: string(name='SourceIdentifier', description='The ID of the rule.

*   If you set the SourceOwner parameter to ALIYUN, set this parameter to the name of the managed rule.
*   If you set the SourceOwner parameter to CUSTOM_FC, set this parameter to the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.

For more information about how to query the name of a managed rule, see [Managed rules](https://help.aliyun.com/document_detail/127404.html).

This parameter is required.', example='required-tags'),
  sourceOwner?: string(name='SourceOwner', description='The type of the rule Valid values:

*   ALIYUN: managed rule.
*   CUSTOM_FC: custom rule.

This parameter is required.', example='ALIYUN'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag keys.

The tag keys cannot be an empty string. The tag keys can be up to 64 characters in length. The tag keys cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

You can specify at most 20 tag keys in each call.', example='key-1'),
      value?: string(name='Value', description='The value of the tag. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. The tag value cannot contain `http://` or `https://`.', example='value-1'),
    }
  ](name='Tag', description='rule attached tags'),
  tagKeyLogicScope?: string(name='TagKeyLogicScope', description='The logical relationship when parameter `TagsScope` takes multiple values, for example: When the parameter `TagsScope` is `"TagsScope.1.TagKey":"a", "TagsScope.1.TagValue":"a", "TagsScope.2.TagKey":"b", "TagsScope.2.TagValue":"b"`, if this parameter is set to` AND`, it means that the rule only applies to resources bound with both tags `a:a` and `b:b`. If not specified, the default logic is `OR`.

It can also be used for the deprecated field `TagKeyScope` (not recommended), for example: When the parameter `TagKeyScope` has a value of `ECS`,`OSS`, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels `ECS` and `OSS`.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key used to filter resources. The rule applies only to the resources with the specified tag key.

>  This parameter applies only to managed rules. You must specify both `TagKeyScope` and `TagValueScope`.', example='ECS', deprecated=true),
  tagValueScope?: string(name='TagValueScope', description='The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  This parameter applies only to managed rules. You must specify both `TagKeyScope` and `TagValueScope`.', example='test', deprecated=true),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='TagKey', example='key-1'),
      tagValue?: string(name='TagValue', description='TagValue', example='value-1'),
    }
  ](name='TagsScope', description='TagsScope'),
}

model CreateConfigRuleShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.

This parameter is required.', example='required-tags'),
  configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.

>  If a rule supports the preceding trigger types, separate the types with a comma (,).

This parameter is required.', example='ConfigurationItemChangeNotification'),
  description?: string(name='Description', description='The description of the rule.', example='example-description'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='ExcludeRegionIdsScope', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource to be excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

>  This parameter applies only to managed rules.', example='lb-t4nbowvtbkss7t326****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='TagKey', example='key-2'),
      tagValue?: string(name='TagValue', description='TagValue', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
  extendContent?: string(name='ExtendContent', description='Optional field, only used in conjunction with the 24-hour cycle execution to set the trigger time.', example='{"fixedHour":"13"}'),
  inputParametersShrink?: string(name='InputParameters', description='The input parameter of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
  maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The intervals at which the rule is triggered. Valid values:

*   One_Hour: 1 hour.
*   Three_Hours: 3 hours.
*   Six_Hours: 6 hours.
*   Twelve_Hours: 12 hours.
*   TwentyFour_Hours (default): 24 hours.

>  This parameter is required if the ConfigRuleTriggerTypes parameter is set to ScheduledNotification.', example='One_Hour'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region to which the rule applies. Separate multiple region IDs with commas (,).

>  This parameter applies only to managed rules.', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group to which the rule applies. Separate multiple resource group IDs with commas (,).

>  This parameter applies only to managed rules.', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='ResourceIdsScope', example='lb-5cmbowstbkss9ta03****'),
  resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
  resourceTypesScopeShrink?: string(name='ResourceTypesScope', description='The type of the resource to be evaluated by the rule. Separate multiple resource types with commas (,).

This parameter is required.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high.
*   2: medium.
*   3: low.

This parameter is required.', example='1'),
  sourceIdentifier?: string(name='SourceIdentifier', description='The ID of the rule.

*   If you set the SourceOwner parameter to ALIYUN, set this parameter to the name of the managed rule.
*   If you set the SourceOwner parameter to CUSTOM_FC, set this parameter to the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.

For more information about how to query the name of a managed rule, see [Managed rules](https://help.aliyun.com/document_detail/127404.html).

This parameter is required.', example='required-tags'),
  sourceOwner?: string(name='SourceOwner', description='The type of the rule Valid values:

*   ALIYUN: managed rule.
*   CUSTOM_FC: custom rule.

This parameter is required.', example='ALIYUN'),
  tagShrink?: string(name='Tag', description='rule attached tags'),
  tagKeyLogicScope?: string(name='TagKeyLogicScope', description='The logical relationship when parameter `TagsScope` takes multiple values, for example: When the parameter `TagsScope` is `"TagsScope.1.TagKey":"a", "TagsScope.1.TagValue":"a", "TagsScope.2.TagKey":"b", "TagsScope.2.TagValue":"b"`, if this parameter is set to` AND`, it means that the rule only applies to resources bound with both tags `a:a` and `b:b`. If not specified, the default logic is `OR`.

It can also be used for the deprecated field `TagKeyScope` (not recommended), for example: When the parameter `TagKeyScope` has a value of `ECS`,`OSS`, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels `ECS` and `OSS`.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key used to filter resources. The rule applies only to the resources with the specified tag key.

>  This parameter applies only to managed rules. You must specify both `TagKeyScope` and `TagValueScope`.', example='ECS', deprecated=true),
  tagValueScope?: string(name='TagValueScope', description='The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  This parameter applies only to managed rules. You must specify both `TagKeyScope` and `TagValueScope`.', example='test', deprecated=true),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='TagKey', example='key-1'),
      tagValue?: string(name='TagValue', description='TagValue', example='value-1'),
    }
  ](name='TagsScope', description='TagsScope'),
}

model CreateConfigRuleResponseBody = {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-5772ba41209e007b****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model CreateConfigRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateConfigRuleResponseBody(name='body'),
}

/**
 * @summary Creates a rule for the current account.
 *
 * @description ## Limits
 * You can use a common account to create up to 200 rules.
 *
 * @param tmpReq CreateConfigRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateConfigRuleResponse
 */
async function createConfigRuleWithOptions(tmpReq: CreateConfigRuleRequest, runtime: Util.RuntimeOptions): CreateConfigRuleResponse {
  Util.validateModel(tmpReq);
  var request = new CreateConfigRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.inputParameters)) {
    request.inputParametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.inputParameters, 'InputParameters', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceTypesScope)) {
    request.resourceTypesScopeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceTypesScope, 'ResourceTypesScope', 'simple');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configRuleName)) {
    body['ConfigRuleName'] = request.configRuleName;
  }
  if (!Util.isUnset(request.configRuleTriggerTypes)) {
    body['ConfigRuleTriggerTypes'] = request.configRuleTriggerTypes;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.excludeRegionIdsScope)) {
    body['ExcludeRegionIdsScope'] = request.excludeRegionIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceGroupIdsScope)) {
    body['ExcludeResourceGroupIdsScope'] = request.excludeResourceGroupIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceIdsScope)) {
    body['ExcludeResourceIdsScope'] = request.excludeResourceIdsScope;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.excludeTagsScope)) {
    bodyFlat['ExcludeTagsScope'] = request.excludeTagsScope;
  }
  if (!Util.isUnset(request.extendContent)) {
    body['ExtendContent'] = request.extendContent;
  }
  if (!Util.isUnset(request.inputParametersShrink)) {
    body['InputParameters'] = request.inputParametersShrink;
  }
  if (!Util.isUnset(request.maximumExecutionFrequency)) {
    body['MaximumExecutionFrequency'] = request.maximumExecutionFrequency;
  }
  if (!Util.isUnset(request.regionIdsScope)) {
    body['RegionIdsScope'] = request.regionIdsScope;
  }
  if (!Util.isUnset(request.resourceGroupIdsScope)) {
    body['ResourceGroupIdsScope'] = request.resourceGroupIdsScope;
  }
  if (!Util.isUnset(request.resourceIdsScope)) {
    body['ResourceIdsScope'] = request.resourceIdsScope;
  }
  if (!Util.isUnset(request.resourceNameScope)) {
    body['ResourceNameScope'] = request.resourceNameScope;
  }
  if (!Util.isUnset(request.resourceTypesScopeShrink)) {
    body['ResourceTypesScope'] = request.resourceTypesScopeShrink;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.sourceIdentifier)) {
    body['SourceIdentifier'] = request.sourceIdentifier;
  }
  if (!Util.isUnset(request.sourceOwner)) {
    body['SourceOwner'] = request.sourceOwner;
  }
  if (!Util.isUnset(request.tagKeyLogicScope)) {
    body['TagKeyLogicScope'] = request.tagKeyLogicScope;
  }
  if (!Util.isUnset(request.tagKeyScope)) {
    body['TagKeyScope'] = request.tagKeyScope;
  }
  if (!Util.isUnset(request.tagValueScope)) {
    body['TagValueScope'] = request.tagValueScope;
  }
  if (!Util.isUnset(request.tagsScope)) {
    bodyFlat['TagsScope'] = request.tagsScope;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateConfigRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a rule for the current account.
 *
 * @description ## Limits
 * You can use a common account to create up to 200 rules.
 *
 * @param request CreateConfigRuleRequest
 * @return CreateConfigRuleResponse
 */
async function createConfigRule(request: CreateConfigRuleRequest): CreateConfigRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createConfigRuleWithOptions(request, runtime);
}

model CreateDeliveryChannelRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must ensure that the token is unique among different requests.

The `token` can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [How to ensure idempotence](https://help.aliyun.com/document_detail/25693.html).', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Specifies whether to deliver resource change logs to the specified destination. If you set this parameter to true, Cloud Config delivers resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true
*   false (default)

> This parameter is available for delivery channels of the OSS, SLS, and MNS types.', example='false'),
  configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Specifies whether to deliver scheduled resource snapshots to the OSS bucket. If the value of this parameter is true, the scheduled resource snapshots are delivered to the specified OSS bucket at 00:00:00 and 12:00:00 on a daily basis. Valid values:

*   true
*   false (default)

> This parameter is applicable only to delivery channels of the OSS type.', example='false'),
  deliveryChannelAssumeRoleArn?: string(name='DeliveryChannelAssumeRoleArn', description='The ARN of the role that you want to assign to the delivery channel. Specify the ARN in the following format: `acs:ram::{accountId}:role/aliyunserviceroleforconfig`.

This parameter is required.', example='acs:ram::100931896542****:role/aliyunserviceroleforconfig'),
  deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that you want to attach to the delivery channel. This parameter is available only for delivery channels of the MNS type.

This parameter specifies the lowest risk level and the resource types for the events to which you want to subscribe.

*   The setting of the lowest risk level for the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

    The `value` field indicates the lowest risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

*   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field indicates the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
  deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.

> If you do not configure this parameter, this parameter is left empty.', example='testoss'),
  deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The Alibaba Cloud Resource Name (ARN) of the delivery destination. Valid values:

*   `acs:oss:{RegionId}:{accountId}:{bucketName}` if your delivery destination is an OSS bucket. Example: `acs:oss:cn-shanghai:100931896542****:new-bucket`.
*   `acs:mns:{RegionId}:{accountId}:/topics/{topicName}` if your delivery destination is an MNS topic. Example: `acs:mns:cn-shanghai:100931896542****:/topics/topic1`.
*   `acs:log:{RegionId}:{accountId}:project/{projectName}/logstore/{logstoreName}` if your delivery destination is a Log Service Logstore. Example: `acs:log:cn-shanghai:100931896542****:project/project1/logstore/logstore1`.

This parameter is required.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery channel. Valid values:

*   OSS: Object Storage Service (OSS)
*   MNS: Message Service (MNS)
*   SLS: Log Service

This parameter is required.', example='OSS'),
  description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
  nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Specifies whether to deliver resource non-compliance events. If you set this parameter to true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are considered non-compliant. Valid values:

*   true
*   false (default)

> This parameter is available only for delivery channels of the SLS or MNS type.', example='false'),
  oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel. Format: `acs:oss:{RegionId}:{accountId}:{bucketName}`.

If you do not configure this parameter, Cloud Config delivers only summary data.

> This parameter is available only for delivery channels of the SLS or MNS type. The maximum storage size of delivery channels of the SLS type is 1 MB, and the maximum storage size of delivery channels of the MNS type is 64 KB.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
}

model CreateDeliveryChannelResponseBody = {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-8e45ff4e06a3a8****'),
  requestId?: string(name='RequestId', description='The request ID.', example='A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG'),
}

model CreateDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDeliveryChannelResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI CreateDeliveryChannel is deprecated, please use Config::2020-09-07::CreateConfigDeliveryChannel,Config::2020-09-07::CreateAggregateConfigDeliveryChannel instead.
 *
 * @summary Creates a delivery channel.
 *
 * @description In this example, a delivery channel is created. The type of the delivery channel is `OSS`, the Alibaba Cloud Resource Name (ARN) of the delivery destination is `acs:oss:cn-shanghai:100931896542****:new-bucket`, and the ARN of the role that is assigned to the delivery channel is `acs:ram::100931896542****:role/aliyunserviceroleforconfig`. The returned result shows that the delivery channel is created, and the ID of the delivery channel is `cdc-8e45ff4e06a3a8****`.
 *
 * @param request CreateDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDeliveryChannelResponse
 */
// Deprecated
async function createDeliveryChannelWithOptions(request: CreateDeliveryChannelRequest, runtime: Util.RuntimeOptions): CreateDeliveryChannelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configurationItemChangeNotification)) {
    body['ConfigurationItemChangeNotification'] = request.configurationItemChangeNotification;
  }
  if (!Util.isUnset(request.configurationSnapshot)) {
    body['ConfigurationSnapshot'] = request.configurationSnapshot;
  }
  if (!Util.isUnset(request.deliveryChannelAssumeRoleArn)) {
    body['DeliveryChannelAssumeRoleArn'] = request.deliveryChannelAssumeRoleArn;
  }
  if (!Util.isUnset(request.deliveryChannelCondition)) {
    body['DeliveryChannelCondition'] = request.deliveryChannelCondition;
  }
  if (!Util.isUnset(request.deliveryChannelName)) {
    body['DeliveryChannelName'] = request.deliveryChannelName;
  }
  if (!Util.isUnset(request.deliveryChannelTargetArn)) {
    body['DeliveryChannelTargetArn'] = request.deliveryChannelTargetArn;
  }
  if (!Util.isUnset(request.deliveryChannelType)) {
    body['DeliveryChannelType'] = request.deliveryChannelType;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.nonCompliantNotification)) {
    body['NonCompliantNotification'] = request.nonCompliantNotification;
  }
  if (!Util.isUnset(request.oversizedDataOSSTargetArn)) {
    body['OversizedDataOSSTargetArn'] = request.oversizedDataOSSTargetArn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI CreateDeliveryChannel is deprecated, please use Config::2020-09-07::CreateConfigDeliveryChannel,Config::2020-09-07::CreateAggregateConfigDeliveryChannel instead.
 *
 * @summary Creates a delivery channel.
 *
 * @description In this example, a delivery channel is created. The type of the delivery channel is `OSS`, the Alibaba Cloud Resource Name (ARN) of the delivery destination is `acs:oss:cn-shanghai:100931896542****:new-bucket`, and the ARN of the role that is assigned to the delivery channel is `acs:ram::100931896542****:role/aliyunserviceroleforconfig`. The returned result shows that the delivery channel is created, and the ID of the delivery channel is `cdc-8e45ff4e06a3a8****`.
 *
 * @param request CreateDeliveryChannelRequest
 * @return CreateDeliveryChannelResponse
 */
// Deprecated
async function createDeliveryChannel(request: CreateDeliveryChannelRequest): CreateDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDeliveryChannelWithOptions(request, runtime);
}

model CreateRemediationRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='AAAAAdDWBF2****'),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-8a973ac2e2be00a2****'),
  invokeType?: string(name='InvokeType', description='The execution mode of the remediation template. Valid values:

*   NON_EXECUTION: The remediation template is not executed.
*   AUTO_EXECUTION: The remediation template is automatically executed.
*   MANUAL_EXECUTION: The remediation template is manually executed.
*   NOT_CONFIG: The execution mode is not specified.

This parameter is required.', example='MANUAL_EXECUTION'),
  params?: string(name='Params', description='The configuration of the remediation template.

For more information about how to obtain the remediation template configuration, see the `TemplateDefinition` response parameter provided in [ListRemediationTemplates](https://help.aliyun.com/document_detail/416781.html).

This parameter is required.', example='{"bucketName": "{resourceId}", "regionId": "{regionId}", "permissionName": "private"}', nullable=true),
  remediationTemplateId?: string(name='RemediationTemplateId', description='The ID of the remediation template.

*   If you set the `RemediationType` parameter to `OOS`, set this parameter to the identifier of the relevant official remediation template, such as `ACS-OSS-PutBucketAcl`. For more information about how to obtain the remediation template identifier, see [ListRemediationTemplates](https://help.aliyun.com/document_detail/416781.html).
*   If you set the `RemediationType` parameter to `FC`, set this parameter to the Alibaba Cloud Resource Name (ARN) of the relevant Function Compute resource, such as `acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/test-php`.

This parameter is required.', example='ACS-OSS-PutBucketAcl'),
  remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid values:

*   OOS: Operation Orchestration Service (official remediation)
*   FC: Function Compute (custom remediation)

This parameter is required.', example='OOS'),
  sourceType?: string(name='SourceType', description='The source of remediation. Valid values:

*   ALIYUN (default): official template.
*   CUSTOM: custom template.
*   NONE: none.', example='ALIYUN'),
}

model CreateRemediationResponseBody = {
  remediationId?: string(name='RemediationId', description='The ID of the remediation template.', example='crr-909ba2d4716700eb****'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}

model CreateRemediationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRemediationResponseBody(name='body'),
}

/**
 * @summary Creates a remediation template for a rule.
 *
 * @description This topic provides an example on how to create a remediation template for the rule `cr-8a973ac2e2be00a2****`. The returned result shows that a remediation template is created and the ID of the remediation template is `crr-909ba2d4716700eb****`.
 *
 * @param request CreateRemediationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRemediationResponse
 */
async function createRemediationWithOptions(request: CreateRemediationRequest, runtime: Util.RuntimeOptions): CreateRemediationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configRuleId)) {
    body['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.invokeType)) {
    body['InvokeType'] = request.invokeType;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }
  if (!Util.isUnset(request.remediationTemplateId)) {
    body['RemediationTemplateId'] = request.remediationTemplateId;
  }
  if (!Util.isUnset(request.remediationType)) {
    body['RemediationType'] = request.remediationType;
  }
  if (!Util.isUnset(request.sourceType)) {
    body['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRemediation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a remediation template for a rule.
 *
 * @description This topic provides an example on how to create a remediation template for the rule `cr-8a973ac2e2be00a2****`. The returned result shows that a remediation template is created and the ID of the remediation template is `crr-909ba2d4716700eb****`.
 *
 * @param request CreateRemediationRequest
 * @return CreateRemediationResponse
 */
async function createRemediation(request: CreateRemediationRequest): CreateRemediationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRemediationWithOptions(request, runtime);
}

model DeactiveAggregateConfigRulesRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-04b3fd170e340007****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).', example='cp-fe416457e0d90022****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule ID. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='cr-5772ba41209e007b****'),
}

model DeactiveAggregateConfigRulesResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-5772ba41209e007b****'),
        errorCode?: string(name='ErrorCode', description='The error code.

*   If the rule is disabled, no error code is returned.
*   If the rule fails to be disabled, an error code is returned. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleNotExists'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='false'),
      }
    ](name='OperateRuleItemList', description='The operations that are performed to disable the rule.'),
  }(name='OperateRuleResult', description='The results of the operations that are performed to disable the specified rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model DeactiveAggregateConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeactiveAggregateConfigRulesResponseBody(name='body'),
}

/**
 * @summary Disables one or more rules in an account group. After a rule is disabled, the resource in the rule is no longer evaluated. The compliance evaluation results before the rule is disabled are still displayed.
 *
 * @description ### [](#)Prerequisites
 * The status of the rule is `ACTIVE`.
 * ### [](#)Description
 * This topic provides an example on how to disable the `cr-5772ba41209e007b****` rule in the `ca-04b3fd170e340007****` account group.
 *
 * @param request DeactiveAggregateConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeactiveAggregateConfigRulesResponse
 */
async function deactiveAggregateConfigRulesWithOptions(request: DeactiveAggregateConfigRulesRequest, runtime: Util.RuntimeOptions): DeactiveAggregateConfigRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeactiveAggregateConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables one or more rules in an account group. After a rule is disabled, the resource in the rule is no longer evaluated. The compliance evaluation results before the rule is disabled are still displayed.
 *
 * @description ### [](#)Prerequisites
 * The status of the rule is `ACTIVE`.
 * ### [](#)Description
 * This topic provides an example on how to disable the `cr-5772ba41209e007b****` rule in the `ca-04b3fd170e340007****` account group.
 *
 * @param request DeactiveAggregateConfigRulesRequest
 * @return DeactiveAggregateConfigRulesResponse
 */
async function deactiveAggregateConfigRules(request: DeactiveAggregateConfigRulesRequest): DeactiveAggregateConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deactiveAggregateConfigRulesWithOptions(request, runtime);
}

model DeactiveConfigRulesRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).', example='cp-fe416457e0d90022****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The ID of the rule. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).', example='cr-19a56457e0d90058****'),
}

model DeactiveConfigRulesResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-19a56457e0d90058****'),
        errorCode?: string(name='ErrorCode', description='The error code.

*   If the rule is disabled, no error code is returned.
*   If the rule fails to be disabled, an error code is returned. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleCanNotDelete'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='false'),
      }
    ](name='OperateRuleItemList', description='The operations that are performed to disable the rule.'),
  }(name='OperateRuleResult', description='The results of the operations that are performed to disable the specified rules.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54FA74D9-45D4-4CA5-9BE1-97F6EA19AF5B'),
}

model DeactiveConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeactiveConfigRulesResponseBody(name='body'),
}

/**
 * @summary Disables a rule. After a rule is disabled, the resource in the rule is no longer evaluated. The compliance evaluation results before the rule is disabled are still displayed.
 *
 * @description ### [](#)Prerequisites
 * The status of the rule is `ACTIVE`.
 * ### [](#)Description
 * This topic provides an example on how to disable the `cr-19a56457e0d90058****` rule.
 *
 * @param request DeactiveConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeactiveConfigRulesResponse
 */
async function deactiveConfigRulesWithOptions(request: DeactiveConfigRulesRequest, runtime: Util.RuntimeOptions): DeactiveConfigRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeactiveConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables a rule. After a rule is disabled, the resource in the rule is no longer evaluated. The compliance evaluation results before the rule is disabled are still displayed.
 *
 * @description ### [](#)Prerequisites
 * The status of the rule is `ACTIVE`.
 * ### [](#)Description
 * This topic provides an example on how to disable the `cr-19a56457e0d90058****` rule.
 *
 * @param request DeactiveConfigRulesRequest
 * @return DeactiveConfigRulesResponse
 */
async function deactiveConfigRules(request: DeactiveConfigRulesRequest): DeactiveConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deactiveConfigRulesWithOptions(request, runtime);
}

model DeleteAggregateCompliancePacksRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-04b3fd170e340007****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackIds?: string(name='CompliancePackIds', description='The ID of the compliance package. Separate multiple compliance package IDs with commas (,).

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-541e626622af0087****'),
  deleteRule?: boolean(name='DeleteRule', description='Specifies whether to delete the rules in the compliance package. Valid values:

*   true: The rules are deleted.
*   false (default): The rules are not deleted.', example='false'),
}

model DeleteAggregateCompliancePacksResponseBody = {
  operateCompliancePacksResult?: {
    operateCompliancePacks?: [ 
      {
        compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-541e626622af0087****'),
        errorCode?: string(name='ErrorCode', description='The error code returned.

*   If the compliance package is deleted, no error code is returned.
*   If the compliance package fails to be deleted, an error code is returned. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='CompliancePackAlreadyPending'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='false'),
      }
    ](name='OperateCompliancePacks', description='An array that contains the deleted compliance packages.'),
  }(name='OperateCompliancePacksResult', description='The results of the delete operations.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model DeleteAggregateCompliancePacksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAggregateCompliancePacksResponseBody(name='body'),
}

/**
 * @summary Deletes the compliance packages of an account group.
 *
 * @description This topic provides an example on how to delete the `cp-541e626622af0087****` compliance package from the `ca-04b3fd170e340007****` account group.
 *
 * @param request DeleteAggregateCompliancePacksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAggregateCompliancePacksResponse
 */
async function deleteAggregateCompliancePacksWithOptions(request: DeleteAggregateCompliancePacksRequest, runtime: Util.RuntimeOptions): DeleteAggregateCompliancePacksResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliancePackIds)) {
    body['CompliancePackIds'] = request.compliancePackIds;
  }
  if (!Util.isUnset(request.deleteRule)) {
    body['DeleteRule'] = request.deleteRule;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAggregateCompliancePacks',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the compliance packages of an account group.
 *
 * @description This topic provides an example on how to delete the `cp-541e626622af0087****` compliance package from the `ca-04b3fd170e340007****` account group.
 *
 * @param request DeleteAggregateCompliancePacksRequest
 * @return DeleteAggregateCompliancePacksResponse
 */
async function deleteAggregateCompliancePacks(request: DeleteAggregateCompliancePacksRequest): DeleteAggregateCompliancePacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAggregateCompliancePacksWithOptions(request, runtime);
}

model DeleteAggregateConfigDeliveryChannelRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-23c6626622af0041****'),
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.

For more information about how to obtain the ID of a delivery channel, see [ListAggregateConfigDeliveryChannels](https://help.aliyun.com/document_detail/429842.html).

This parameter is required.', example='cdc-38c3013b46c9002c****'),
}

model DeleteAggregateConfigDeliveryChannelResponseBody = {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-38c3013b46c9002c****'),
  requestId?: string(name='RequestId', description='The request ID.', example='FCC2F05C-F672-5665-8102-0020DF66B9B9'),
}

model DeleteAggregateConfigDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAggregateConfigDeliveryChannelResponseBody(name='body'),
}

/**
 * @summary Deletes a delivery channel from an account group.
 *
 * @description This topic provides an example on how to delete the `cdc-38c3013b46c9002c****` delivery channel from the `ca-23c6626622af0041****` account group. The returned result shows that the `cdc-38c3013b46c9002c****` delivery channel is deleted.
 *
 * @param request DeleteAggregateConfigDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAggregateConfigDeliveryChannelResponse
 */
async function deleteAggregateConfigDeliveryChannelWithOptions(request: DeleteAggregateConfigDeliveryChannelRequest, runtime: Util.RuntimeOptions): DeleteAggregateConfigDeliveryChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.deliveryChannelId)) {
    query['DeliveryChannelId'] = request.deliveryChannelId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAggregateConfigDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a delivery channel from an account group.
 *
 * @description This topic provides an example on how to delete the `cdc-38c3013b46c9002c****` delivery channel from the `ca-23c6626622af0041****` account group. The returned result shows that the `cdc-38c3013b46c9002c****` delivery channel is deleted.
 *
 * @param request DeleteAggregateConfigDeliveryChannelRequest
 * @return DeleteAggregateConfigDeliveryChannelResponse
 */
async function deleteAggregateConfigDeliveryChannel(request: DeleteAggregateConfigDeliveryChannelRequest): DeleteAggregateConfigDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAggregateConfigDeliveryChannelWithOptions(request, runtime);
}

model DeleteAggregateConfigRulesRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule ID. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-4e3d626622af0080****'),
}

model DeleteAggregateConfigRulesResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-4e3d626622af0080****'),
        errorCode?: string(name='ErrorCode', description='The error code returned.

*   If the rule is deleted, no error code is returned.
*   If the rule fails to be deleted, an error code is returned. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleCanNotDelete'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='false'),
      }
    ](name='OperateRuleItemList', description='The details of the result.'),
  }(name='OperateRuleResult', description='The results of the delete operations.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model DeleteAggregateConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAggregateConfigRulesResponseBody(name='body'),
}

/**
 * @summary Deletes one or more rules from an account group. You can delete a rule in the Cloud Config console. After you delete the rule, the configurations of the rule are deleted.
 *
 * @description This topic provides an example on how to delete the `cr-4e3d626622af0080****` rule from the `ca-a4e5626622af0079****` account group.
 *
 * @param request DeleteAggregateConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAggregateConfigRulesResponse
 */
async function deleteAggregateConfigRulesWithOptions(request: DeleteAggregateConfigRulesRequest, runtime: Util.RuntimeOptions): DeleteAggregateConfigRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAggregateConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more rules from an account group. You can delete a rule in the Cloud Config console. After you delete the rule, the configurations of the rule are deleted.
 *
 * @description This topic provides an example on how to delete the `cr-4e3d626622af0080****` rule from the `ca-a4e5626622af0079****` account group.
 *
 * @param request DeleteAggregateConfigRulesRequest
 * @return DeleteAggregateConfigRulesResponse
 */
async function deleteAggregateConfigRules(request: DeleteAggregateConfigRulesRequest): DeleteAggregateConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAggregateConfigRulesWithOptions(request, runtime);
}

model DeleteAggregateRemediationsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-6b4a626622af0012****'),
  remediationIds?: string(name='RemediationIds', description='The ID of the remediation template. Separate multiple remediation template IDs with commas (,).

For more information about how to obtain the ID of a remediation template, see [ListAggregateRemediations](https://help.aliyun.com/document_detail/270036.html).

This parameter is required.', example='crr-909ba2d4716700eb****'),
}

model DeleteAggregateRemediationsResponseBody = {
  remediationDeleteResults?: [ 
    {
      errorMessage?: string(name='ErrorMessage', description='The error code returned.

*   If the remediation template is deleted, no error code is returned.
*   If the remediation template fails to be deleted, an error code is returned. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='RemediationConfigNotExist'),
      remediationId?: string(name='RemediationId', description='The ID of the remediation template.', example='crr-909ba2d4716700eb****'),
      success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
    }
  ](name='RemediationDeleteResults', description='The results of the delete operation.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4BE28FB1-616A-5586-82E4-F34FB2AF7441'),
}

model DeleteAggregateRemediationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAggregateRemediationsResponseBody(name='body'),
}

/**
 * @summary Deletes one or more remediation templates from a rule in an account group.
 *
 * @description This topic provides an example on how to delete the remediation template whose ID is `crr-909ba2d4716700eb****` from the account group whose ID is `ca-6b4a626622af0012****`. The returned result shows that the remediation template whose ID is `crr-909ba2d4716700eb****` is deleted.
 *
 * @param request DeleteAggregateRemediationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAggregateRemediationsResponse
 */
async function deleteAggregateRemediationsWithOptions(request: DeleteAggregateRemediationsRequest, runtime: Util.RuntimeOptions): DeleteAggregateRemediationsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.remediationIds)) {
    body['RemediationIds'] = request.remediationIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAggregateRemediations',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more remediation templates from a rule in an account group.
 *
 * @description This topic provides an example on how to delete the remediation template whose ID is `crr-909ba2d4716700eb****` from the account group whose ID is `ca-6b4a626622af0012****`. The returned result shows that the remediation template whose ID is `crr-909ba2d4716700eb****` is deleted.
 *
 * @param request DeleteAggregateRemediationsRequest
 * @return DeleteAggregateRemediationsResponse
 */
async function deleteAggregateRemediations(request: DeleteAggregateRemediationsRequest): DeleteAggregateRemediationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAggregateRemediationsWithOptions(request, runtime);
}

model DeleteAggregatorsRequest {
  aggregatorIds?: string(name='AggregatorIds', description='The ID of the account group. Separate multiple IDs with commas (,).

This parameter is required.', example='ca-9190626622af00a9****'),
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='AAAAAdDWBF2****'),
}

model DeleteAggregatorsResponseBody = {
  operateAggregatorsResult?: {
    operateAggregators?: [ 
      {
        aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-dacf86d8314e00eb****'),
        errorCode?: string(name='ErrorCode', description='The error code returned.

> No error code is returned for the account group if the account group is deleted.', example='AccountNotExisted'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='false'),
      }
    ](name='OperateAggregators', description='The details of the account group.'),
  }(name='OperateAggregatorsResult', description='The returned result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='8195B664-9565-4685-89AC-8B5F04B44B92'),
}

model DeleteAggregatorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAggregatorsResponseBody(name='body'),
}

/**
 * @summary The management account or delegated administrator account of a resource directory can delete an account group.
 *
 * @description ### [](#)Background information
 * After you delete an account group, the following changes occur to Cloud Config:
 * *   The rules and compliance packages of the account group are deleted and cannot be recovered.
 * *   All compliance results generated in the account group are automatically deleted and cannot be recovered.
 * *   Service-linked roles for Cloud Config of member accounts in the account group are retained.
 * *   If the account groups to which a member belongs are all deleted, the member account uses Cloud Config as an independent Alibaba Cloud account.
 * ### [](#)Description
 * This topic provides an example on how to delete the account group whose ID is `ca-9190626622af00a9****`.
 *
 * @param request DeleteAggregatorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAggregatorsResponse
 */
async function deleteAggregatorsWithOptions(request: DeleteAggregatorsRequest, runtime: Util.RuntimeOptions): DeleteAggregatorsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorIds)) {
    body['AggregatorIds'] = request.aggregatorIds;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAggregators',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The management account or delegated administrator account of a resource directory can delete an account group.
 *
 * @description ### [](#)Background information
 * After you delete an account group, the following changes occur to Cloud Config:
 * *   The rules and compliance packages of the account group are deleted and cannot be recovered.
 * *   All compliance results generated in the account group are automatically deleted and cannot be recovered.
 * *   Service-linked roles for Cloud Config of member accounts in the account group are retained.
 * *   If the account groups to which a member belongs are all deleted, the member account uses Cloud Config as an independent Alibaba Cloud account.
 * ### [](#)Description
 * This topic provides an example on how to delete the account group whose ID is `ca-9190626622af00a9****`.
 *
 * @param request DeleteAggregatorsRequest
 * @return DeleteAggregatorsResponse
 */
async function deleteAggregators(request: DeleteAggregatorsRequest): DeleteAggregatorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAggregatorsWithOptions(request, runtime);
}

model DeleteCompliancePacksRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='AAAAAdDWBF2****'),
  compliancePackIds?: string(name='CompliancePackIds', description='The ID of the compliance package. Separate multiple compliance package IDs with commas (,).

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-541e626622af0087****'),
  deleteRule?: boolean(name='DeleteRule', description='Specifies whether to delete the rules in the compliance package. Valid values:

*   true: The rules are deleted.
*   false (default): The rules are not deleted.', example='false'),
}

model DeleteCompliancePacksResponseBody = {
  operateCompliancePacksResult?: {
    operateCompliancePacks?: [ 
      {
        compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-541e626622af0087****'),
        errorCode?: string(name='ErrorCode', description='The error code returned.

*   If the compliance package is deleted, no error code is returned.
*   If the compliance package fails to be deleted, an error code is returned. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='CompliancePackAlreadyPending'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
      }
    ](name='OperateCompliancePacks', description='An array that contains compliance packages that are deleted.'),
  }(name='OperateCompliancePacksResult', description='The returned result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model DeleteCompliancePacksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCompliancePacksResponseBody(name='body'),
}

/**
 * @summary Deletes one or more compliance packages.
 *
 * @description This topic provides an example on how to delete the `cp-541e626622af0087****` compliance package.
 *
 * @param request DeleteCompliancePacksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCompliancePacksResponse
 */
async function deleteCompliancePacksWithOptions(request: DeleteCompliancePacksRequest, runtime: Util.RuntimeOptions): DeleteCompliancePacksResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliancePackIds)) {
    body['CompliancePackIds'] = request.compliancePackIds;
  }
  if (!Util.isUnset(request.deleteRule)) {
    body['DeleteRule'] = request.deleteRule;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCompliancePacks',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more compliance packages.
 *
 * @description This topic provides an example on how to delete the `cp-541e626622af0087****` compliance package.
 *
 * @param request DeleteCompliancePacksRequest
 * @return DeleteCompliancePacksResponse
 */
async function deleteCompliancePacks(request: DeleteCompliancePacksRequest): DeleteCompliancePacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCompliancePacksWithOptions(request, runtime);
}

model DeleteConfigDeliveryChannelRequest {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.

For more information about how to obtain the ID of a delivery channel, see [DescribeDeliveryChannels](https://help.aliyun.com/document_detail/429841.html).

This parameter is required.', example='cdc-38c32e87cadb002c****'),
}

model DeleteConfigDeliveryChannelResponseBody = {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-38c32e87cadb002c****'),
  requestId?: string(name='RequestId', description='The request ID.', example='35F1DA37-ECB5-54E9-AC22-0D9111A665AA'),
}

model DeleteConfigDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteConfigDeliveryChannelResponseBody(name='body'),
}

/**
 * @summary Deletes a delivery channel.
 *
 * @description This topic provides an example on how to delete the `cdc-38c3013b46c9002c****` delivery channel. The returned result shows that the `cdc-38c3013b46c9002c****` delivery channel is deleted.
 *
 * @param request DeleteConfigDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteConfigDeliveryChannelResponse
 */
async function deleteConfigDeliveryChannelWithOptions(request: DeleteConfigDeliveryChannelRequest, runtime: Util.RuntimeOptions): DeleteConfigDeliveryChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deliveryChannelId)) {
    query['DeliveryChannelId'] = request.deliveryChannelId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteConfigDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a delivery channel.
 *
 * @description This topic provides an example on how to delete the `cdc-38c3013b46c9002c****` delivery channel. The returned result shows that the `cdc-38c3013b46c9002c****` delivery channel is deleted.
 *
 * @param request DeleteConfigDeliveryChannelRequest
 * @return DeleteConfigDeliveryChannelResponse
 */
async function deleteConfigDeliveryChannel(request: DeleteConfigDeliveryChannelRequest): DeleteConfigDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteConfigDeliveryChannelWithOptions(request, runtime);
}

model DeleteConfigRulesRequest {
  configRuleIds?: string(name='ConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/609222.html).

This parameter is required.', example='cr-9908626622af0035****'),
}

model DeleteConfigRulesResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-9908626622af0035****'),
        errorCode?: string(name='ErrorCode', description='The error code.

*   If the rule is disabled, no error code is returned.
*   If the rule fails to be disabled, an error code is returned. For more information about error codes, see [Error codes](https://api.alibabacloud.com/document/Config/2020-09-07/errorCode).', example='ConfigRuleCanNotDelete'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='false'),
      }
    ](name='OperateRuleItemList', description='The result of the delete operation.'),
  }(name='OperateRuleResult', description='The results of the delete operations.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6721BBD3-F2A6-5349-9051-EE0111036D3F'),
}

model DeleteConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteConfigRulesResponseBody(name='body'),
}

/**
 * @summary Deletes rules.
 *
 * @description In this example, the rule whose ID is cr-9908626622af0035\\*\\*\\*\\* is deleted.
 *
 * @param request DeleteConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteConfigRulesResponse
 */
async function deleteConfigRulesWithOptions(request: DeleteConfigRulesRequest, runtime: Util.RuntimeOptions): DeleteConfigRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes rules.
 *
 * @description In this example, the rule whose ID is cr-9908626622af0035\\*\\*\\*\\* is deleted.
 *
 * @param request DeleteConfigRulesRequest
 * @return DeleteConfigRulesResponse
 */
async function deleteConfigRules(request: DeleteConfigRulesRequest): DeleteConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteConfigRulesWithOptions(request, runtime);
}

model DeleteRemediationsRequest {
  remediationIds?: string(name='RemediationIds', description='The ID of the remediation template. Separate multiple remediation template IDs with commas (,).

For more information about how to obtain the ID of a remediation template, see [ListRemediations](https://help.aliyun.com/document_detail/270772.html).

This parameter is required.', example='crr-909ba2d4716700eb****'),
}

model DeleteRemediationsResponseBody = {
  remediationDeleteResults?: [ 
    {
      errorMessage?: string(name='ErrorMessage', description='The error code returned.

*   If the remediation template is deleted, no error code is returned.
*   If the remediation template fails to be deleted, an error code is returned. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='RemediationConfigNotExist'),
      remediationId?: string(name='RemediationId', description='The ID of the remediation template.', example='crr-909ba2d4716700eb****'),
      success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
    }
  ](name='RemediationDeleteResults', description='The returned result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4BE28FB1-616A-5586-82E4-F34FB2AF7441'),
}

model DeleteRemediationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRemediationsResponseBody(name='body'),
}

/**
 * @summary Deletes one or more configured remediation templates that are associated with a rule.
 *
 * @description This topic provides an example on how to delete the remediation template `crr-909ba2d4716700eb****`. The returned result shows that the remediation template whose ID is `crr-909ba2d4716700eb****` is deleted.
 *
 * @param request DeleteRemediationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRemediationsResponse
 */
async function deleteRemediationsWithOptions(request: DeleteRemediationsRequest, runtime: Util.RuntimeOptions): DeleteRemediationsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.remediationIds)) {
    body['RemediationIds'] = request.remediationIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRemediations',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more configured remediation templates that are associated with a rule.
 *
 * @description This topic provides an example on how to delete the remediation template `crr-909ba2d4716700eb****`. The returned result shows that the remediation template whose ID is `crr-909ba2d4716700eb****` is deleted.
 *
 * @param request DeleteRemediationsRequest
 * @return DeleteRemediationsResponse
 */
async function deleteRemediations(request: DeleteRemediationsRequest): DeleteRemediationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRemediationsWithOptions(request, runtime);
}

model DescribeRemediationRequest {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-3184626622af003****'),
  remediationId?: string(name='RemediationId', description='The ID of the remediation configuration.', example='crr-f381cf0c1c2f004e****'),
}

model DescribeRemediationResponseBody = {
  remediation?: {
    accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account.', example='100931896542****'),
    configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-3184626622af003****'),
    invokeType?: string(name='InvokeType', description='The execution mode of the remediation template. Valid values:

*   NON_EXECUTION: The remediation template was not executed.
*   AUTO_EXECUTION: The remediation template was automatically executed.
*   MANUAL_EXECUTION: The remediation template was manually executed.
*   NOT_CONFIG: The execution mode was not specified.', example='AUTO_EXECUTION'),
    lastSuccessfulInvocationId?: string(name='LastSuccessfulInvocationId', description='The record ID of the last successful execution of the remediation template.', example='bd7629fb-cac8-42fe-bcb1-e362c5a6****'),
    lastSuccessfulInvocationTime?: long(name='LastSuccessfulInvocationTime', description='The timestamp of the last successful execution of the remediation template. Unit: milliseconds.', example='1625451393589'),
    lastSuccessfulInvocationType?: string(name='LastSuccessfulInvocationType', description='The mode of the last successful execution of the remediation template. Valid values:

*   NON_EXECUTION: The remediation template was not executed.
*   AUTO_EXECUTION: The remediation template was automatically executed.
*   MANUAL_EXECUTION: The remediation template was manually executed.
*   NOT_CONFIG: The execution mode was not specified.', example='AUTO_EXECUTION'),
    remediationId?: string(name='RemediationId', description='The ID of the remediation configuration.', example='crr-f381cf0c1c2f004e****'),
    remediationOriginParams?: string(name='RemediationOriginParams', description='The converted configuration of the remediation template. This parameter is returned only for an OOS remediation template.

This parameter is required.', example='{"bucketName": "{resourceId}", "regionId": "{regionId}", "permissionName": "private"}'),
    remediationSourceType?: string(name='RemediationSourceType', description='The source of the remediation template. Valid values:

*   ALIYUN: official template
*   CUSTOM: custom template
*   NONE: none', example='ALIYUN'),
    remediationTemplateId?: string(name='RemediationTemplateId', description='The ID of the remediation template.', example='ACS-OSS-PutBucketAcl'),
    remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid values:

*   OOS: Operation Orchestration Service (official remediation)
*   FC: Function Compute (custom remediation)', example='OOS'),
  }(name='Remediation', description='The details of the remediation configuration.'),
  requestId?: string(name='RequestId', description='The request ID.', example='79BE07A7-46A5-5D3C-B378-0ACDA979****'),
}

model DescribeRemediationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRemediationResponseBody(name='body'),
}

/**
 * @summary This topic provides an example on how to query the details of a remediation configuration whose ID is crr-f381cf0c1c2f004e\\*\\*\\*\\*.
 *
 * @param request DescribeRemediationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRemediationResponse
 */
async function describeRemediationWithOptions(request: DescribeRemediationRequest, runtime: Util.RuntimeOptions): DescribeRemediationResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRemediation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary This topic provides an example on how to query the details of a remediation configuration whose ID is crr-f381cf0c1c2f004e\\*\\*\\*\\*.
 *
 * @param request DescribeRemediationRequest
 * @return DescribeRemediationResponse
 */
async function describeRemediation(request: DescribeRemediationRequest): DescribeRemediationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRemediationWithOptions(request, runtime);
}

model DetachAggregateConfigRuleToCompliancePackRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-75b4626622af00c3****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-5bb1626622af00bd****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-a124626622af00e7****'),
}

model DetachAggregateConfigRuleToCompliancePackResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-a124626622af00e7****'),
        errorCode?: string(name='ErrorCode', description='The error code.

*   This parameter is empty if the rule is removed from the compliance package.
*   An error code is returned if the rule fails to be removed from the compliance package. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleNotExists'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
      }
    ](name='OperateRuleItemList', description='The result of the operation to remove the rule.'),
  }(name='OperateRuleResult', description='The results of the operations to remove one or more rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB12A'),
}

model DetachAggregateConfigRuleToCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachAggregateConfigRuleToCompliancePackResponseBody(name='body'),
}

/**
 * @summary Removes one or more rules in an account group from a compliance package.
 *
 * @description ### Prerequisites
 * One or more rules are added to a compliance package.
 * ### Usage notes
 * The sample request in this topic shows you how to remove the `cr-6cc4626622af00e7****` rule in the `ca-75b4626622af00c3****` account group from the `cp-5bb1626622af00bd****` compliance package.
 *
 * @param request DetachAggregateConfigRuleToCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachAggregateConfigRuleToCompliancePackResponse
 */
async function detachAggregateConfigRuleToCompliancePackWithOptions(request: DetachAggregateConfigRuleToCompliancePackRequest, runtime: Util.RuntimeOptions): DetachAggregateConfigRuleToCompliancePackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachAggregateConfigRuleToCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes one or more rules in an account group from a compliance package.
 *
 * @description ### Prerequisites
 * One or more rules are added to a compliance package.
 * ### Usage notes
 * The sample request in this topic shows you how to remove the `cr-6cc4626622af00e7****` rule in the `ca-75b4626622af00c3****` account group from the `cp-5bb1626622af00bd****` compliance package.
 *
 * @param request DetachAggregateConfigRuleToCompliancePackRequest
 * @return DetachAggregateConfigRuleToCompliancePackResponse
 */
async function detachAggregateConfigRuleToCompliancePack(request: DetachAggregateConfigRuleToCompliancePackRequest): DetachAggregateConfigRuleToCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachAggregateConfigRuleToCompliancePackWithOptions(request, runtime);
}

model DetachConfigRuleToCompliancePackRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-5bb1626622af00bd****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule ID. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-6cc4626622af00e7****'),
}

model DetachConfigRuleToCompliancePackResponseBody = {
  operateRuleResult?: {
    operateRuleItemList?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-6cc4626622af00e7****'),
        errorCode?: string(name='ErrorCode', description='The error code returned.

*   This parameter is empty if the rule is removed from the compliance package.
*   An error code is returned if the rule fails to be removed from the compliance package. For more information about error codes, see [Error codes](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleNotExists'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
      }
    ](name='OperateRuleItemList', description='The result of the operation to remove the rule.'),
  }(name='OperateRuleResult', description='The results of the operations to remove one or more rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AC7AED1-172F-42AE-9C12-295BC2ADB12A'),
}

model DetachConfigRuleToCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachConfigRuleToCompliancePackResponseBody(name='body'),
}

/**
 * @summary Removes one or more rules from a compliance package.
 *
 * @description ### Prerequisites
 * One or more rules are added to a compliance package.
 * ### Usage notes
 * This topic provides an example on how to remove the `cr-6cc4626622af00e7****` rule from the `cp-5bb1626622af00bd****` compliance package.
 *
 * @param request DetachConfigRuleToCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachConfigRuleToCompliancePackResponse
 */
async function detachConfigRuleToCompliancePackWithOptions(request: DetachConfigRuleToCompliancePackRequest, runtime: Util.RuntimeOptions): DetachConfigRuleToCompliancePackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachConfigRuleToCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes one or more rules from a compliance package.
 *
 * @description ### Prerequisites
 * One or more rules are added to a compliance package.
 * ### Usage notes
 * This topic provides an example on how to remove the `cr-6cc4626622af00e7****` rule from the `cp-5bb1626622af00bd****` compliance package.
 *
 * @param request DetachConfigRuleToCompliancePackRequest
 * @return DetachConfigRuleToCompliancePackResponse
 */
async function detachConfigRuleToCompliancePack(request: DetachConfigRuleToCompliancePackRequest): DetachConfigRuleToCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachConfigRuleToCompliancePackWithOptions(request, runtime);
}

model EvaluatePreConfigRulesRequest {
  enableManagedRules?: boolean(name='EnableManagedRules', description='Specifies whether to enable the managed rule. Valid values:

*   true: enables the managed rule.
*   false: does not enable the managed rule. This is the default value.

>  After you create an evaluation rule, a managed rule that has the same settings as the evaluation rule is created. After you create a resource, the managed rule can be used to continuously check the compliance of the resource.', example='false'),
  resourceEvaluateItems?: [ 
    {
      resourceLogicalId?: string(name='ResourceLogicalId', description='The logical ID of the resource.', example='ResourceLogicId-test'),
      resourceProperties?: string(name='ResourceProperties', description='The properties of the resource.', example='{
    "ImageId": "ubuntu_18_04_64_20G_alibase_20190624.vhd",
    "SecurityGroupId": "sg-bp15ed6xe1yxeycg****",
    "HostName": "LocalHostName",
    "RegionId": "cn-hangzhou"
}'),
      resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::Instance'),
      rules?: [ 
        {
          identifier?: string(name='Identifier', description='The identifier of the evaluation rule.

For more information about how to obtain the identifier of an evaluation rule, see [ListManagedRules](https://help.aliyun.com/document_detail/467810.html).', example='ecs-instance-deletion-protection-enabled'),
          inputParameters?: string(name='InputParameters', description='The input parameters of the evaluation rule.', example='{}'),
        }
      ](name='Rules', description='The evaluation rules.'),
    }
  ](name='ResourceEvaluateItems', description='The resources that you want to evaluate.

This parameter is required.'),
  resourceTypeFormat?: string(name='ResourceTypeFormat', description='下一个查询开始Token', example='ros'),
}

model EvaluatePreConfigRulesShrinkRequest {
  enableManagedRules?: boolean(name='EnableManagedRules', description='Specifies whether to enable the managed rule. Valid values:

*   true: enables the managed rule.
*   false: does not enable the managed rule. This is the default value.

>  After you create an evaluation rule, a managed rule that has the same settings as the evaluation rule is created. After you create a resource, the managed rule can be used to continuously check the compliance of the resource.', example='false'),
  resourceEvaluateItemsShrink?: string(name='ResourceEvaluateItems', description='The resources that you want to evaluate.

This parameter is required.'),
  resourceTypeFormat?: string(name='ResourceTypeFormat', description='下一个查询开始Token', example='ros'),
}

model EvaluatePreConfigRulesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='129ECF1C-7897-1131-BD0F-4B588AC05400'),
  resourceEvaluations?: [ 
    {
      resourceLogicalId?: string(name='ResourceLogicalId', description='The logical ID of the resource.

>  If the ResourceLogicalId request parameter is left empty, the value of the ResourceLogicalId response parameter is generated based on the value of the `ResourceProperties` parameter.', example='ResourceLogicId-test'),
      resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::Instance'),
      rules?: [ 
        {
          annotation?: string(name='Annotation', description='The reason why the resource was evaluated as incompliant.', example='{\\\\"configuration\\\\":\\\\"false\\\\",\\\\"desiredValue\\\\":\\\\"True\\\\",\\\\"operator\\\\":\\\\"StringEquals\\\\",\\\\"property\\\\":\\\\"$.DeletionProtection\\\\"}'),
          complianceType?: string(name='ComplianceType', description='The compliance type of the resource that was evaluated by using the evaluation rule. Valid values:

*   COMPLIANT: The resource was evaluated as compliant.
*   NON_COMPLIANT: The resource was evaluated as incompliant.
*   NOT_APPLICABLE: The evaluation rule does not apply to the resource.', example='NON_COMPLIANT'),
          helpUrl?: string(name='HelpUrl', description='The URL of the topic that describes how the managed rule remediates the incompliant configurations.', example='https://example.aliyundoc.com'),
          identifier?: string(name='Identifier', description='The identifier of the evaluation rule.', example='ecs-instance-deletion-protection-enabled'),
        }
      ](name='Rules', description='The evaluation rules.'),
    }
  ](name='ResourceEvaluations', description='The details of the compliance evaluation result.'),
}

model EvaluatePreConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EvaluatePreConfigRulesResponseBody(name='body'),
}

/**
 * @summary Executes evaluation rules to evaluate resources.
 *
 * @param tmpReq EvaluatePreConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EvaluatePreConfigRulesResponse
 */
async function evaluatePreConfigRulesWithOptions(tmpReq: EvaluatePreConfigRulesRequest, runtime: Util.RuntimeOptions): EvaluatePreConfigRulesResponse {
  Util.validateModel(tmpReq);
  var request = new EvaluatePreConfigRulesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resourceEvaluateItems)) {
    request.resourceEvaluateItemsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceEvaluateItems, 'ResourceEvaluateItems', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.enableManagedRules)) {
    body['EnableManagedRules'] = request.enableManagedRules;
  }
  if (!Util.isUnset(request.resourceEvaluateItemsShrink)) {
    body['ResourceEvaluateItems'] = request.resourceEvaluateItemsShrink;
  }
  if (!Util.isUnset(request.resourceTypeFormat)) {
    body['ResourceTypeFormat'] = request.resourceTypeFormat;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EvaluatePreConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Executes evaluation rules to evaluate resources.
 *
 * @param request EvaluatePreConfigRulesRequest
 * @return EvaluatePreConfigRulesResponse
 */
async function evaluatePreConfigRules(request: EvaluatePreConfigRulesRequest): EvaluatePreConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return evaluatePreConfigRulesWithOptions(request, runtime);
}

model GenerateAggregateCompliancePackReportRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-fdc8626622af00f9****'),
  multiFiles?: boolean(name='MultiFiles'),
}

model GenerateAggregateCompliancePackReportResponseBody = {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-fdc8626622af00f9****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GenerateAggregateCompliancePackReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateAggregateCompliancePackReportResponseBody(name='body'),
}

/**
 * @summary Generates a compliance evaluation report based on a compliance package in an account group.
 *
 * @description > You can call this operation to generate the latest compliance evaluation report. To download the report, call the GetAggregateConfigRulesReport operation. For more information, see [GetAggregateCompliancePackReport](https://help.aliyun.com/document_detail/262699.html).
 * This topic provides an example on how to generate a compliance evaluation report based on the `cp-fdc8626622af00f9****` compliance package in the `ca-f632626622af0079****` account group.
 *
 * @param request GenerateAggregateCompliancePackReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateAggregateCompliancePackReportResponse
 */
async function generateAggregateCompliancePackReportWithOptions(request: GenerateAggregateCompliancePackReportRequest, runtime: Util.RuntimeOptions): GenerateAggregateCompliancePackReportResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    body['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.multiFiles)) {
    body['MultiFiles'] = request.multiFiles;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateAggregateCompliancePackReport',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a compliance evaluation report based on a compliance package in an account group.
 *
 * @description > You can call this operation to generate the latest compliance evaluation report. To download the report, call the GetAggregateConfigRulesReport operation. For more information, see [GetAggregateCompliancePackReport](https://help.aliyun.com/document_detail/262699.html).
 * This topic provides an example on how to generate a compliance evaluation report based on the `cp-fdc8626622af00f9****` compliance package in the `ca-f632626622af0079****` account group.
 *
 * @param request GenerateAggregateCompliancePackReportRequest
 * @return GenerateAggregateCompliancePackReportResponse
 */
async function generateAggregateCompliancePackReport(request: GenerateAggregateCompliancePackReportRequest): GenerateAggregateCompliancePackReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateAggregateCompliancePackReportWithOptions(request, runtime);
}

model GenerateAggregateConfigRulesReportRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule ID. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='cr-25d86457e0d900b5****'),
}

model GenerateAggregateConfigRulesReportResponseBody = {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-f632626622af0079****'),
  reportId?: string(name='ReportId', description='The ID of the compliance evaluation report.', example='crp-88176457e0d900c9****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GenerateAggregateConfigRulesReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateAggregateConfigRulesReportResponseBody(name='body'),
}

/**
 * @summary Generates a compliance evaluation report for the rules in a specified account group.
 *
 * @description > You can call this operation to generate the latest compliance evaluation report. To download the report, call the GetAggregateConfigRulesReport operation. For more information, see [GetAggregateConfigRulesReport](https://help.aliyun.com/document_detail/262706.html).
 * The topic provides an example on how to generate a compliance evaluation report based on all rules in the `ca-f632626622af0079****` account group.
 *
 * @param request GenerateAggregateConfigRulesReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateAggregateConfigRulesReportResponse
 */
async function generateAggregateConfigRulesReportWithOptions(request: GenerateAggregateConfigRulesReportRequest, runtime: Util.RuntimeOptions): GenerateAggregateConfigRulesReportResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    body['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateAggregateConfigRulesReport',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a compliance evaluation report for the rules in a specified account group.
 *
 * @description > You can call this operation to generate the latest compliance evaluation report. To download the report, call the GetAggregateConfigRulesReport operation. For more information, see [GetAggregateConfigRulesReport](https://help.aliyun.com/document_detail/262706.html).
 * The topic provides an example on how to generate a compliance evaluation report based on all rules in the `ca-f632626622af0079****` account group.
 *
 * @param request GenerateAggregateConfigRulesReportRequest
 * @return GenerateAggregateConfigRulesReportResponse
 */
async function generateAggregateConfigRulesReport(request: GenerateAggregateConfigRulesReportRequest): GenerateAggregateConfigRulesReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateAggregateConfigRulesReportWithOptions(request, runtime);
}

model GenerateAggregateResourceInventoryRequest {
  accountIds?: string(name='AccountIds', description='The IDs of member accounts in the account group. Separate multiple member account IDs with commas (,).', example='126672004088****'),
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-a91d626622af0035****'),
  regions?: string(name='Regions', description='The IDs of the regions to which the resources belong. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  resourceDeleted?: int32(name='ResourceDeleted', description='Indicates whether the resource is deleted. Valid values:

*   1 (default): The resource is retained.
*   0: The resource is deleted.', example='1'),
  resourceTypes?: string(name='ResourceTypes', description='The resource types. Separate multiple resource types with commas (,).', example='ACS::ECS::Instance'),
}

model GenerateAggregateResourceInventoryResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5111CBA6-6485-57EB-BCDD-85D8BB31E7A7'),
}

model GenerateAggregateResourceInventoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateAggregateResourceInventoryResponseBody(name='body'),
}

/**
 * @summary Generates a downloadable inventory for global resources in an account group.
 *
 * @description This topic provides an example to show how to generate a downloadable inventory for global resources in the account group ca-a91d626622af0035\\*\\*\\*\\*.
 *
 * @param request GenerateAggregateResourceInventoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateAggregateResourceInventoryResponse
 */
async function generateAggregateResourceInventoryWithOptions(request: GenerateAggregateResourceInventoryRequest, runtime: Util.RuntimeOptions): GenerateAggregateResourceInventoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountIds)) {
    query['AccountIds'] = request.accountIds;
  }
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.regions)) {
    query['Regions'] = request.regions;
  }
  if (!Util.isUnset(request.resourceDeleted)) {
    query['ResourceDeleted'] = request.resourceDeleted;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateAggregateResourceInventory',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a downloadable inventory for global resources in an account group.
 *
 * @description This topic provides an example to show how to generate a downloadable inventory for global resources in the account group ca-a91d626622af0035\\*\\*\\*\\*.
 *
 * @param request GenerateAggregateResourceInventoryRequest
 * @return GenerateAggregateResourceInventoryResponse
 */
async function generateAggregateResourceInventory(request: GenerateAggregateResourceInventoryRequest): GenerateAggregateResourceInventoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateAggregateResourceInventoryWithOptions(request, runtime);
}

model GenerateCompliancePackReportRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The `token` can contain only ASCII characters and cannot exceed 64 characters in length.', example='AAAAAdDWBF2****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-a8a8626622af0082****'),
}

model GenerateCompliancePackReportResponseBody = {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-a8a8626622af0082****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GenerateCompliancePackReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateCompliancePackReportResponseBody(name='body'),
}

/**
 * @summary Generates a compliance evaluation report based on a compliance package.
 *
 * @description > You can call this operation to generate the latest compliance evaluation report. To download the report, call the GetCompliancePackReport operation. For more information, see [GetCompliancePackReport](https://help.aliyun.com/document_detail/263347.html).
 * This topic provides an example on how to generate a compliance evaluation report based on the `cp-a8a8626622af0082****` compliance package.
 *
 * @param request GenerateCompliancePackReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateCompliancePackReportResponse
 */
async function generateCompliancePackReportWithOptions(request: GenerateCompliancePackReportRequest, runtime: Util.RuntimeOptions): GenerateCompliancePackReportResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    body['CompliancePackId'] = request.compliancePackId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateCompliancePackReport',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a compliance evaluation report based on a compliance package.
 *
 * @description > You can call this operation to generate the latest compliance evaluation report. To download the report, call the GetCompliancePackReport operation. For more information, see [GetCompliancePackReport](https://help.aliyun.com/document_detail/263347.html).
 * This topic provides an example on how to generate a compliance evaluation report based on the `cp-a8a8626622af0082****` compliance package.
 *
 * @param request GenerateCompliancePackReportRequest
 * @return GenerateCompliancePackReportResponse
 */
async function generateCompliancePackReport(request: GenerateCompliancePackReportRequest): GenerateCompliancePackReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateCompliancePackReportWithOptions(request, runtime);
}

model GenerateConfigRulesReportRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='AAAAAdDWBF2****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The ID of the rule. Separate multiple rule IDs with commas (,).

For more information about how to query the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).', example='cr-25d86457e0d900b5****'),
}

model GenerateConfigRulesReportResponseBody = {
  reportId?: string(name='ReportId', description='The ID of the compliance evaluation report.', example='crp-88176457e0d900c9****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GenerateConfigRulesReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateConfigRulesReportResponseBody(name='body'),
}

/**
 * @summary Generates a compliance evaluation report for a rule.
 *
 * @description >  You can call this operation to generate the latest compliance evaluation report. To download the report, call the GetConfigRulesReport operation. For more information, see [GetConfigRulesReport](https://help.aliyun.com/document_detail/263608.html).
 * This topic provides an example of how to generate a compliance evaluation report based on all existing rules.
 *
 * @param request GenerateConfigRulesReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateConfigRulesReportResponse
 */
async function generateConfigRulesReportWithOptions(request: GenerateConfigRulesReportRequest, runtime: Util.RuntimeOptions): GenerateConfigRulesReportResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    body['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateConfigRulesReport',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a compliance evaluation report for a rule.
 *
 * @description >  You can call this operation to generate the latest compliance evaluation report. To download the report, call the GetConfigRulesReport operation. For more information, see [GetConfigRulesReport](https://help.aliyun.com/document_detail/263608.html).
 * This topic provides an example of how to generate a compliance evaluation report based on all existing rules.
 *
 * @param request GenerateConfigRulesReportRequest
 * @return GenerateConfigRulesReportResponse
 */
async function generateConfigRulesReport(request: GenerateConfigRulesReportRequest): GenerateConfigRulesReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateConfigRulesReportWithOptions(request, runtime);
}

model GenerateResourceInventoryRequest {
  regions?: string(name='Regions', description='The region IDs of the resources. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  resourceDeleted?: int32(name='ResourceDeleted', description='Indicates whether the resource is deleted. Valid values:

*   1 (default): The resource is retained.
*   0: The resource is deleted.', example='1'),
  resourceTypes?: string(name='ResourceTypes', description='The resource types. Separate multiple resource types with commas (,).', example='ACS::ECS::Instance'),
}

model GenerateResourceInventoryResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='E1225EEA-B5F8-538F-8E37-A943986B6290'),
}

model GenerateResourceInventoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateResourceInventoryResponseBody(name='body'),
}

/**
 * @summary Generates a resource inventory for global resources.
 *
 * @description This topic provides an example on how to generate a resource inventory for global resources of the current account.
 *
 * @param request GenerateResourceInventoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateResourceInventoryResponse
 */
async function generateResourceInventoryWithOptions(request: GenerateResourceInventoryRequest, runtime: Util.RuntimeOptions): GenerateResourceInventoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regions)) {
    query['Regions'] = request.regions;
  }
  if (!Util.isUnset(request.resourceDeleted)) {
    query['ResourceDeleted'] = request.resourceDeleted;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateResourceInventory',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a resource inventory for global resources.
 *
 * @description This topic provides an example on how to generate a resource inventory for global resources of the current account.
 *
 * @param request GenerateResourceInventoryRequest
 * @return GenerateResourceInventoryResponse
 */
async function generateResourceInventory(request: GenerateResourceInventoryRequest): GenerateResourceInventoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateResourceInventoryWithOptions(request, runtime);
}

model GetAdvancedSearchFileResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='9366FE45-3C83-54FB-8BB1-44176B200706'),
  resourceSearch?: {
    downloadUrl?: string(name='DownloadUrl', description='The download URL of the resource file.'),
    resourceInventoryGenerateTime?: long(name='ResourceInventoryGenerateTime', description='The time when the resource file was generated. The value is a timestamp. Unit: milliseconds.', example='1688281755480'),
    status?: string(name='Status', description='The generation status of the resource file. Valid values:

*   CREATING: The resource file is being generated.
*   COMPLETE: The resource file is generated.', example='COMPLETE'),
  }(name='ResourceSearch', description='The information about the resource file.'),
}

model GetAdvancedSearchFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAdvancedSearchFileResponseBody(name='body'),
}

/**
 * @summary Obtains the last resource advanced search file that is generated within the current account. You can call this operation to obtain the URL of the resource advanced search file.
 *
 * @description ### [](#)Prerequisites
 * You must call the [CreateAdvancedSearchFile](https://help.aliyun.com/document_detail/2511967.html) operation to create a resource advanced search file. Then, you can call this operation to obtain the URL of the resource advanced search file.
 *
 * @param request GetAdvancedSearchFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAdvancedSearchFileResponse
 */
async function getAdvancedSearchFileWithOptions(runtime: Util.RuntimeOptions): GetAdvancedSearchFileResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetAdvancedSearchFile',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the last resource advanced search file that is generated within the current account. You can call this operation to obtain the URL of the resource advanced search file.
 *
 * @description ### [](#)Prerequisites
 * You must call the [CreateAdvancedSearchFile](https://help.aliyun.com/document_detail/2511967.html) operation to create a resource advanced search file. Then, you can call this operation to obtain the URL of the resource advanced search file.
 *
 * @return GetAdvancedSearchFileResponse
 */
async function getAdvancedSearchFile(): GetAdvancedSearchFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAdvancedSearchFileWithOptions(runtime);
}

model GetAggregateAccountComplianceByPackRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-04b3fd170e340007****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-541e626622af0087****'),
}

model GetAggregateAccountComplianceByPackResponseBody = {
  accountComplianceResult?: {
    accountCompliances?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the member account in the account group.', example='100931896542****'),
        accountName?: string(name='AccountName', description='The name of the member account in the account group.', example='Alice'),
        complianceType?: string(name='ComplianceType', description='The compliance evaluation result. Valid values:

*   COMPLIANT: The resource was evaluated as compliant.
*   NON_COMPLIANT: The resource was evaluated as incompliant.
*   NOT_APPLICABLE: The rule did not apply to your resource.
*   INSUFFICIENT_DATA: No resource data was available.', example='COMPLIANT'),
      }
    ](name='AccountCompliances', description='The compliance evaluation result of member accounts.'),
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-541e626622af0087****'),
    nonCompliantCount?: int32(name='NonCompliantCount', description='The number of non-compliant member accounts.', example='0'),
    totalCount?: int32(name='TotalCount', description='The total number of member accounts.', example='2'),
  }(name='AccountComplianceResult', description='The compliance evaluation results of member accounts for which the compliance package takes effect in an account group.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GetAggregateAccountComplianceByPackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateAccountComplianceByPackResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation results of member accounts for which a compliance package takes effect in an account group.
 *
 * @description This topic provides an example on how to query the compliance evaluation results of member accounts for which the `cp-541e626622af0087****` compliance package takes effect in the `ca-04b3fd170e340007****` account group. The returned result shows that two member accounts are monitored by the compliance package and they are both evaluated as compliant.
 *
 * @param request GetAggregateAccountComplianceByPackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateAccountComplianceByPackResponse
 */
async function getAggregateAccountComplianceByPackWithOptions(request: GetAggregateAccountComplianceByPackRequest, runtime: Util.RuntimeOptions): GetAggregateAccountComplianceByPackResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateAccountComplianceByPack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation results of member accounts for which a compliance package takes effect in an account group.
 *
 * @description This topic provides an example on how to query the compliance evaluation results of member accounts for which the `cp-541e626622af0087****` compliance package takes effect in the `ca-04b3fd170e340007****` account group. The returned result shows that two member accounts are monitored by the compliance package and they are both evaluated as compliant.
 *
 * @param request GetAggregateAccountComplianceByPackRequest
 * @return GetAggregateAccountComplianceByPackResponse
 */
async function getAggregateAccountComplianceByPack(request: GetAggregateAccountComplianceByPackRequest): GetAggregateAccountComplianceByPackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateAccountComplianceByPackWithOptions(request, runtime);
}

model GetAggregateAdvancedSearchFileRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-4b1b626622af000c****'),
}

model GetAggregateAdvancedSearchFileResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6DB86284-DB7F-5936-B210-3B53D6D41B03'),
  resourceSearch?: {
    downloadUrl?: string(name='DownloadUrl', description='The download URL of the resource file.'),
    resourceInventoryGenerateTime?: long(name='ResourceInventoryGenerateTime', description='The time when the resource file was generated. The value is a timestamp.

Unit: milliseconds.', example='1691375618130'),
    status?: string(name='Status', description='The generation status of the resource file. Valid values:

*   CREATING: The resource file is being generated.
*   COMPLETE: The resource file is generated.', example='COMPLETE'),
  }(name='ResourceSearch', description='The information about the resource file.'),
}

model GetAggregateAdvancedSearchFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateAdvancedSearchFileResponseBody(name='body'),
}

/**
 * @summary Queries the most recently generated resource file of an account group.
 *
 * @param request GetAggregateAdvancedSearchFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateAdvancedSearchFileResponse
 */
async function getAggregateAdvancedSearchFileWithOptions(request: GetAggregateAdvancedSearchFileRequest, runtime: Util.RuntimeOptions): GetAggregateAdvancedSearchFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateAdvancedSearchFile',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the most recently generated resource file of an account group.
 *
 * @param request GetAggregateAdvancedSearchFileRequest
 * @return GetAggregateAdvancedSearchFileResponse
 */
async function getAggregateAdvancedSearchFile(request: GetAggregateAdvancedSearchFileRequest): GetAggregateAdvancedSearchFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateAdvancedSearchFileWithOptions(request, runtime);
}

model GetAggregateCompliancePackRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-fdc8626622af00f9****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetAggregateCompliancePackShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-fdc8626622af00f9****'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetAggregateCompliancePackResponseBody = {
  compliancePack?: {
    accountId?: long(name='AccountId', description='The ID of the management account to which the compliance package belongs.', example='100931896542****'),
    aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-f632626622af0079****'),
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-fdc8626622af00f9****'),
    compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='The name of the compliance package.'),
    compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template.', example='ct-5f26ff4e06a300c4****'),
    configRules?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-a260626622af0005****'),
        configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='The name of the rule.'),
        configRuleParameters?: [ 
          {
            parameterName?: string(name='ParameterName', description='The name of the input parameter.', example='bandwidth'),
            parameterValue?: string(name='ParameterValue', description='The value of the input parameter.', example='10'),
            required?: boolean(name='Required', description='Indicates whether the input parameter was required. Valid values:

*   true
*   false', example='true'),
          }
        ](name='ConfigRuleParameters', description='The details of the input parameter of the rule.'),
        description?: string(name='Description', description='The description of the rule.', example='The description of the rule.'),
        managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The ID of the rule template.', example='eip-bandwidth-limit'),
        resourceTypesScope?: string(name='ResourceTypesScope', description='The type of the resource evaluated based on the rule. Multiple resource types are separated with commas (,).', example='ACS::EIP::EipAddress'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
      }
    ](name='ConfigRules', description='The rules in the compliance package.'),
    createTimestamp?: long(name='CreateTimestamp', description='The timestamp when the compliance package was created. Unit: milliseconds.', example='1624243657000'),
    description?: string(name='Description', description='The description of the compliance package.', example='The description of the compliance package.'),
    riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
    scope?: {
      excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of regions that are excluded. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
      excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups whose resources you do not want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzc7r7rhx****'),
      excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that is not evaluated by using the compliance package.', example='eip-8vbf3x310fn56ijfd****'),
      excludeTagsScope?: [ 
        {
          tagKey?: string(name='TagKey', description='The key of the tag.', example='key-2'),
          tagValue?: string(name='TagValue', description='The value of the tag.', example='value-2'),
        }
      ](name='ExcludeTagsScope', description='The scope of the tag that is excluded.'),
      regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources were evaluated by using the compliance package.', example='cn-hangzhou'),
      resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources are evaluated by using the compliance package.', example='rg-aekzc7r7rhx****'),
      resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources to which the rule applies. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
      tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that is evaluated by using the compliance package.', example='ECS'),
      tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that is evaluated by using the compliance package.', example='test'),
      tagsScope?: [ 
        {
          tagKey?: string(name='TagKey', description='The key of the tag.', example='key-1'),
          tagValue?: string(name='TagValue', description='The value of the tag.', example='value-1'),
        }
      ](name='TagsScope', description='The tag scope.'),
    }(name='Scope', description='The evaluation scope of the compliance package.'),
    status?: string(name='Status', description='The status of the compliance package. Valid values:

*   ACTIVE: The compliance package was normal.
*   CREATING: The compliance package was being created.', example='ACTIVE'),
    tags?: [ 
      {
        tagKey?: string(name='TagKey', description='The tag keys of the resource.', example='key-1'),
        tagValue?: string(name='TagValue', description='The tag values of the resource.', example='value-1'),
      }
    ](name='Tags', description='The tags.'),
    templateContent?: string(name='TemplateContent', description='The information about the current compliance package template. The rules in the template do not contain custom function rules. You can quickly create the same compliance package for other accounts or account groups based on the template information.', example='{
  "configRuleTemplates": [
    {
      "configRuleName": "OSS-test-name",
      "scope": {
        "complianceResourceTypes": [
          "ACS::OSS::Bucket"
        ]
      },
      "description": "test-description",
      "source": {
        "owner": "ALIYUN",
        "identifier": "oss-bucket-referer-xxx",
        "sourceDetails": [
          {
            "messageType": "ConfigurationItemChangeNotification"
          }
        ]
      },
      "inputParameters": {
        "allowEmptyReferer": "true",
        "allowReferers": "http://www.aliyun.com"
      }
    }
  ]
}'),
  }(name='CompliancePack', description='The details of the compliance package.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GetAggregateCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateCompliancePackResponseBody(name='body'),
}

/**
 * @summary Queries the details of a compliance package in an account group.
 *
 * @description The topic provides an example on how to query the details of a compliance package whose ID is `cp-fdc8626622af00f9****` in an account group whose ID is `ca-f632626622af0079****`.
 *
 * @param tmpReq GetAggregateCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateCompliancePackResponse
 */
async function getAggregateCompliancePackWithOptions(tmpReq: GetAggregateCompliancePackRequest, runtime: Util.RuntimeOptions): GetAggregateCompliancePackResponse {
  Util.validateModel(tmpReq);
  var request = new GetAggregateCompliancePackShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a compliance package in an account group.
 *
 * @description The topic provides an example on how to query the details of a compliance package whose ID is `cp-fdc8626622af00f9****` in an account group whose ID is `ca-f632626622af0079****`.
 *
 * @param request GetAggregateCompliancePackRequest
 * @return GetAggregateCompliancePackResponse
 */
async function getAggregateCompliancePack(request: GetAggregateCompliancePackRequest): GetAggregateCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateCompliancePackWithOptions(request, runtime);
}

model GetAggregateCompliancePackReportRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-fdc8626622af00f9****'),
}

model GetAggregateCompliancePackReportResponseBody = {
  compliancePackReport?: {
    accountId?: long(name='AccountId', description='The ID of the management account to which the compliance package belongs.', example='100931896542****'),
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-fdc8626622af00f9****'),
    reportCreateTimestamp?: long(name='ReportCreateTimestamp', description='The timestamp when the compliance evaluation report was generated. Unit: milliseconds.', example='1624330246640'),
    reportStatus?: string(name='ReportStatus', description='The status of the compliance evaluation report. Valid values:

*   NONE: The compliance evaluation report is not generated.
*   CREATING: The compliance evaluation report is being generated.
*   COMPLETE: The compliance evaluation report is generated.', example='COMPLETE'),
    reportUrl?: string(name='ReportUrl', description='The URL that is used to download the compliance evaluation report.'),
  }(name='CompliancePackReport', description='The compliance evaluation report that is generated based on a compliance package.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0D234DAC-1ABD-42E8-9475-BE317857E29B'),
}

model GetAggregateCompliancePackReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateCompliancePackReportResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation report that is generated based on a compliance package of an account group.
 *
 * @description > Before you call this operation, you must call the GenerateAggregateCompliancePackReport operation to generate the latest compliance evaluation report based on a compliance package. For more information, see [GenerateAggregateCompliancePackReport](https://help.aliyun.com/document_detail/262687.html).
 * This topic provides an example on how to query the compliance evaluation report that is generated based on the `cp-fdc8626622af00f9****` compliance package in the `ca-f632626622af0079****` account group.
 *
 * @param request GetAggregateCompliancePackReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateCompliancePackReportResponse
 */
async function getAggregateCompliancePackReportWithOptions(request: GetAggregateCompliancePackReportRequest, runtime: Util.RuntimeOptions): GetAggregateCompliancePackReportResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateCompliancePackReport',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation report that is generated based on a compliance package of an account group.
 *
 * @description > Before you call this operation, you must call the GenerateAggregateCompliancePackReport operation to generate the latest compliance evaluation report based on a compliance package. For more information, see [GenerateAggregateCompliancePackReport](https://help.aliyun.com/document_detail/262687.html).
 * This topic provides an example on how to query the compliance evaluation report that is generated based on the `cp-fdc8626622af00f9****` compliance package in the `ca-f632626622af0079****` account group.
 *
 * @param request GetAggregateCompliancePackReportRequest
 * @return GetAggregateCompliancePackReportResponse
 */
async function getAggregateCompliancePackReport(request: GetAggregateCompliancePackReportRequest): GetAggregateCompliancePackReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateCompliancePackReportWithOptions(request, runtime);
}

model GetAggregateComplianceSummaryRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-a91d626622af0035****', nullable=false),
}

model GetAggregateComplianceSummaryResponseBody = {
  complianceSummary?: {
    complianceSummaryByConfigRule?: {
      complianceSummaryTimestamp?: long(name='ComplianceSummaryTimestamp', description='The time when the compliance statistics were collected. Unit: milliseconds.', example='1589853822103'),
      compliantCount?: int32(name='CompliantCount', description='The number of compliant rules.', example='4'),
      nonCompliantCount?: int32(name='NonCompliantCount', description='The number of non-compliant rules.', example='5'),
      totalCount?: long(name='TotalCount', description='The total number of rules.', example='9'),
    }(name='ComplianceSummaryByConfigRule', description='The summary of compliance statistics from the rule dimension.'),
    complianceSummaryByResource?: {
      complianceSummaryTimestamp?: long(name='ComplianceSummaryTimestamp', description='The time when the compliance statistics were collected. Unit: milliseconds.', example='1589853822103'),
      compliantCount?: int32(name='CompliantCount', description='The number of compliant resources.', example='20'),
      nonCompliantCount?: int32(name='NonCompliantCount', description='The number of non-compliant resources.', example='11'),
      totalCount?: long(name='TotalCount', description='The total number of resources.', example='31'),
    }(name='ComplianceSummaryByResource', description='The summary of compliance statistics from the resource dimension.'),
  }(name='ComplianceSummary', description='The compliance statistics.'),
  requestId?: string(name='RequestId', description='The request ID.', example='929B8360-BD57-54FF-96DB-AD1D9B476769'),
}

model GetAggregateComplianceSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateComplianceSummaryResponseBody(name='body'),
}

/**
 * @summary Queries the compliance statistics of an account group.
 *
 * @description This topic provides an example on how to query the compliance statistics of resources and rules in the account group ca-a91d626622af0035\\*\\*\\*\\*.
 *
 * @param request GetAggregateComplianceSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateComplianceSummaryResponse
 */
async function getAggregateComplianceSummaryWithOptions(request: GetAggregateComplianceSummaryRequest, runtime: Util.RuntimeOptions): GetAggregateComplianceSummaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateComplianceSummary',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance statistics of an account group.
 *
 * @description This topic provides an example on how to query the compliance statistics of resources and rules in the account group ca-a91d626622af0035\\*\\*\\*\\*.
 *
 * @param request GetAggregateComplianceSummaryRequest
 * @return GetAggregateComplianceSummaryResponse
 */
async function getAggregateComplianceSummary(request: GetAggregateComplianceSummaryRequest): GetAggregateComplianceSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateComplianceSummaryWithOptions(request, runtime);
}

model GetAggregateConfigDeliveryChannelRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.

For more information about how to obtain the ID of a delivery channel, see [ListAggregateConfigDeliveryChannels](https://help.aliyun.com/document_detail/429842.html).

This parameter is required.', example='cdc-d9106457e0d900b1****'),
}

model GetAggregateConfigDeliveryChannelResponseBody = {
  deliveryChannel?: {
    accountId?: string(name='AccountId', description='The ID of the member in the account group.', example='120886317861****'),
    aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-a4e5626622af0079****'),
    compliantSnapshot?: boolean(name='CompliantSnapshot', description='Indicates whether the specified destination receives scheduled compliant snapshots. Cloud Config delivers scheduled compliant snapshots at `04:00Z` and `16:00Z` to Log Service every day. The time is displayed in UTC. Valid values:

*   true: The specified destination receives scheduled compliant snapshots.
*   false: The specified destination does not receive scheduled compliant snapshots.', example='false'),
    configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Indicates whether the specified destination receives resource change logs. If the value of this parameter is true, Cloud Config delivers the resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true: The specified destination receives resource change logs.
*   false: The specified destination does not receive resource change logs.', example='true'),
    configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Indicates whether the specified destination receives scheduled resource snapshots. Cloud Config delivers scheduled resource snapshots at `04:00Z` and `16:00Z` to OSS, MNS, or Log Service every day. The time is displayed in UTC. Valid values:

*   true: The specified destination receives scheduled resource snapshots.
*   false: The specified destination does not receive scheduled resource snapshots.', example='false'),
    deliveryChannelAssumeRoleArn?: string(name='DeliveryChannelAssumeRoleArn', description='The ARN of the role that is assigned to the delivery channel.', example='acs:ram::120886317861****:role/aliyunserviceroleforconfig'),
    deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that is attached to the delivery channel. This parameter is available when you deliver data of all types to MNS or deliver snapshots to Log Service.

*   If the value of the DeliveryChannelType parameter is MNS, take note of the following settings of the lowest risk level and resource types of the events to which you subscribed:

    *   The lowest risk level of the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

        The `value` field indicates the risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

    *   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

        The `values` field indicates the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`

*   If you set the DeliveryChannelType parameter to SLS, the setting of the resource types of the snapshots to which you want to deliver is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the snapshots to which you want to deliver. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
    deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-d9106457e0d900b1****'),
    deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.', example='myDeliveryChannel'),
    deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The ARN of the delivery destination.

*   If the value of the DeliveryChannelType parameter is OSS, the value of this parameter is the ARN of the destination OSS bucket.
*   If the value of the DeliveryChannelType parameter is MNS, the value of this parameter is the ARN of the destination MNS topic.
*   If the value of the DeliveryChannelType parameter is SLS, the value of this parameter is the ARN of the destination Log Service Logstore.', example='acs:oss:cn-shanghai:120886317861****:new-bucket'),
    deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery channel. Valid values:

*   OSS: Object Storage Service (OSS)
*   MNS: Message Service (MNS)
*   SLS: Log Service', example='OSS'),
    deliverySnapshotTime?: string(name='DeliverySnapshotTime', description='The time when Cloud Config delivers scheduled resources snapshots every day.

Format: `HH:mmZ`. This time is displayed in UTC.', example='09:10Z'),
    description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
    nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Indicates whether the specified destination receives resource non-compliance events. If the value of this parameter is true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are evaluated as non-compliant. Valid values:

*   true: The specified destination receives resource non-compliance events.
*   false: The specified destination does not receive resource non-compliance events.', example='false'),
    oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which the delivered data is transferred when the size of the data exceeds the specified upper limit of the delivery channel.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
    status?: int32(name='Status', description='The status of the delivery channel. Valid values:

*   0: The delivery channel is disabled.
*   1: The delivery channel is enabled.', example='1'),
  }(name='DeliveryChannel', description='The information about a delivery channel.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DC300244-FCE3-5061-8214-C27ECB668487'),
}

model GetAggregateConfigDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateConfigDeliveryChannelResponseBody(name='body'),
}

/**
 * @summary Queries the information about a delivery channel in an account group.
 *
 * @param request GetAggregateConfigDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateConfigDeliveryChannelResponse
 */
async function getAggregateConfigDeliveryChannelWithOptions(request: GetAggregateConfigDeliveryChannelRequest, runtime: Util.RuntimeOptions): GetAggregateConfigDeliveryChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.deliveryChannelId)) {
    query['DeliveryChannelId'] = request.deliveryChannelId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateConfigDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a delivery channel in an account group.
 *
 * @param request GetAggregateConfigDeliveryChannelRequest
 * @return GetAggregateConfigDeliveryChannelResponse
 */
async function getAggregateConfigDeliveryChannel(request: GetAggregateConfigDeliveryChannelRequest): GetAggregateConfigDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateConfigDeliveryChannelWithOptions(request, runtime);
}

model GetAggregateConfigRuleRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-7f00626622af0041****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

You can call the [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html) operation to obtain the rule ID.

This parameter is required.', example='cr-7f7d626622af0041****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetAggregateConfigRuleShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-7f00626622af0041****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

You can call the [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html) operation to obtain the rule ID.

This parameter is required.', example='cr-7f7d626622af0041****'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetAggregateConfigRuleResponseBody = {
  configRule?: {
    accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the rule belongs.', example='120886317861****'),
    accountIdsScope?: string(name='AccountIdsScope', description='The IDs of the members to which the rule applies. Separate multiple member IDs with commas (,).', example='120886317861****'),
    compliance?: {
      complianceType?: string(name='ComplianceType', description='The statistics on the compliance evaluation results by compliance type. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to your resources.
*   INSUFFICIENT_DATA: No resource data is available.', example='NON_COMPLIANT'),
      count?: int32(name='Count', description='The number of evaluated resources.', example='3'),
    }(name='Compliance', description='The details of compliance evaluation results.'),
    configRuleArn?: string(name='ConfigRuleArn', description='The ARN of the managed rule.', example='acs:config::100931896542****:rule/cr-7f7d626622af0041****'),
    configRuleEvaluationStatus?: {
      firstActivatedTimestamp?: long(name='FirstActivatedTimestamp', description='The timestamp when the rule was first triggered.', example='1624932221993'),
      firstEvaluationStarted?: boolean(name='FirstEvaluationStarted', description='Indicates whether resources were evaluated based on the rule. Valid values:

*   true: Resources were evaluated based on the rule.
*   false: Resources were not evaluated based on the rule.', example='true'),
      lastErrorCode?: string(name='LastErrorCode', description='The error code returned for the last failed compliance evaluation.', example='TimeOut'),
      lastErrorMessage?: string(name='LastErrorMessage', description='The error message returned for the last failed compliance evaluation.', example='time out'),
      lastFailedEvaluationTimestamp?: long(name='LastFailedEvaluationTimestamp', description='The timestamp when the last failed compliance evaluation of the rule ended. Unit: milliseconds.', example='1614687022000'),
      lastFailedInvocationTimestamp?: long(name='LastFailedInvocationTimestamp', description='The timestamp when the last failed compliance evaluation of the rule started. Unit: milliseconds.', example='1614687022000'),
      lastSuccessfulEvaluationTimestamp?: long(name='LastSuccessfulEvaluationTimestamp', description='The timestamp when the last successful compliance evaluation of the rule ended. Unit: milliseconds.', example='1624932227486'),
      lastSuccessfulInvocationTimestamp?: long(name='LastSuccessfulInvocationTimestamp', description='The timestamp when the last successful compliance evaluation of the rule started. Unit: milliseconds.', example='1624932227476'),
    }(name='ConfigRuleEvaluationStatus', description='The information about compliance evaluations performed by the rule.'),
    configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-7f7d626622af0041****'),
    configRuleName?: string(name='ConfigRuleName', description='The name of the monitoring rule.', example='The name of the rule.'),
    configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:

*   ACTIVE: The rule is being used to monitor resource configurations.
*   DELETING: The rule is being deleted.
*   EVALUATING: The rule is triggered and is being used to monitor resource configurations.
*   INACTIVE: The rule is disabled and is no longer used to monitor resource configurations.', example='ACTIVE'),
    configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The managed rule is triggered by configuration changes.
*   ScheduledNotification: The managed rule is periodically triggered.', example='ConfigurationItemChangeNotification'),
    createBy?: {
      aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-04b3fd170e340007****'),
      aggregatorName?: string(name='AggregatorName', description='The name of the account group.', example='Test_Group'),
      compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-541e626622af008****'),
      compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='The name of the compliance package.'),
      creatorId?: string(name='CreatorId', description='The ID of the account that was used to create the rule.', example='100931896542****'),
      creatorName?: string(name='CreatorName', description='The name of the account that was used to create the rule.', example='Alice'),
      creatorType?: string(name='CreatorType', description='The type of the entity to which the rule belongs. The value is fixed to `AGGREGATOR`, which indicates an account group.', example='AGGREGATOR'),
    }(name='CreateBy', description='The information about the creation of the rule.'),
    createTimestamp?: long(name='CreateTimestamp', description='The timestamp when the rule was created. Unit: milliseconds.', example='1604684022000'),
    description?: string(name='Description', description='The description of the managed rule.', example='The description of the managed rule.'),
    excludeAccountIdsScope?: string(name='ExcludeAccountIdsScope', description='The ID of the member account to which the rule does not apply, which means that the resources within the member account are not evaluated based on the rule.

>  This parameter applies only to a managed rule.', example='120886317861****'),
    excludeFolderIdsScope?: string(name='ExcludeFolderIdsScope', description='The ID of the resource directory to which the rule does not apply, which means that the resources within member accounts in the resource directory are not evaluated based on the rule.

> 
*   This parameter applies only to a rule of a global account group.
*   This parameter applies only to a managed rule.', example='fd-pWmkqZ****'),
    excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions excluded from the compliance evaluations performed by the rule. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
    excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups excluded from the compliance evaluations performed by the rule. Separate multiple resource group IDs with commas (,).', example='rg-aekzdibsjjc****'),
    excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource excluded from the compliance evaluations performed by the rule.', example='23642660635687****'),
    excludeTagsScope?: [ 
      {
        tagKey?: string(name='TagKey', description='The key of the tag.', example='key-2'),
        tagValue?: string(name='TagValue', description='The value of the tag.', example='value-2'),
      }
    ](name='ExcludeTagsScope', description='The scope of the tag that is excluded.'),
    extendContent?: string(name='ExtendContent', description='The extended content, which is temporarily only used to configure the trigger time with a 24-hour cycle trigger.', example='{"fixedHour":"12"}'),
    folderIdsScope?: string(name='FolderIdsScope', description='The ID of the resource directory to which the rule applies, which means that the resources within member accounts in the resource directory are evaluated based on the rule.

> 
*   This parameter applies only to rules of a global account group.
*   This parameter applies only to managed rules.', example='fd-ZtHsRH****'),
    inputParameters?: map[string]any(name='InputParameters', description='The input parameters of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
    managedRule?: {
      compulsoryInputParameterDetails?: map[string]any(name='CompulsoryInputParameterDetails', description='The required input parameters of the managed rule.', example='{}'),
      description?: string(name='Description', description='The description of the managed rule.', example='The description of the managed rule.'),
      identifier?: string(name='Identifier', description='The identifier of the managed rule.', example='ram-user-mfa-check'),
      labels?: [ string ](name='Labels', description='The tags of the managed rule.'),
      managedRuleName?: string(name='ManagedRuleName', description='The name of the managed rule.', example='ram-user-mfa-check'),
      optionalInputParameterDetails?: map[string]any(name='OptionalInputParameterDetails', description='The optional input parameters of the managed rule.', example='{}'),
      sourceDetails?: [ 
        {
          eventSource?: string(name='EventSource', description='The event source of the managed rule.

>  Only events related to Cloud Config are supported. The value is fixed to aliyun.config.', example='aliyun.config'),
          maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The intervals at which the managed rule is triggered. Valid values:

*   One_Hour: 1 hour.
*   Three_Hours: 3 hours.
*   Six_Hours: 6 hours.
*   Twelve_Hours: 12 hours
*   TwentyFour_Hours: 24 hours', example='One_Hour'),
          messageType?: string(name='MessageType', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The managed rule is triggered by configuration changes.
*   ScheduledNotification: The managed rule is periodically triggered.', example='ConfigurationItemChangeNotification'),
        }
      ](name='SourceDetails', description='The details of the source of the managed rule.'),
    }(name='ManagedRule', description='The details of the managed rule.'),
    maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The intervals at which the managed rule is triggered. Valid values:

*   One_Hour: 1 hour.
*   Three_Hours: 3 hours.
*   Six_Hours: 6 hours.
*   Twelve_Hours: 12 hours
*   TwentyFour_Hours: 24 hours', example='One_Hour'),
    modifiedTimestamp?: long(name='ModifiedTimestamp', description='The timestamp when the rule was last updated. Unit: milliseconds.', example='1614687022000'),
    regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region to which the rule applies.', example='global'),
    resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group to which the rule applies.', example='rg-aekzdibsjjc****'),
    resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources to which the rule applies. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
    resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
    resourceTypesScope?: string(name='ResourceTypesScope', description='The type of the resource evaluated by the rule.', example='ACS::RAM::User'),
    riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rule. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
    source?: {
      identifier?: string(name='Identifier', description='The identifier of the rule.

*   If the rule was created based on a managed rule, the value of this parameter is the name of the managed rule.
*   If the rule is a custom rule, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.', example='acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config'),
      owner?: string(name='Owner', description='The way in which the rule was created. Valid values:

*   CUSTOM_FC: The rule is a custom rule.
*   ALIYUN: The rule was created based on a managed rule of Alibaba Cloud.', example='ALIYUN'),
      sourceDetails?: [ 
        {
          eventSource?: string(name='EventSource', description='The event source of the managed rule.

>  Only events related to Cloud Config are supported. The value is fixed to aliyun.config.', example='aliyun.config'),
          maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The intervals at which the managed rule is triggered. Valid values:

*   One_Hour: 1 hour.
*   Three_Hours: 3 hours.
*   Six_Hours: 6 hours.
*   Twelve_Hours: 12 hours
*   TwentyFour_Hours: 24 hours', example='One_Hour'),
          messageType?: string(name='MessageType', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The managed rule is triggered by configuration changes.
*   ScheduledNotification: The managed rule is periodically triggered.', example='ConfigurationItemChangeNotification'),
        }
      ](name='SourceDetails', description='The details of the source of the rule.'),
    }(name='Source', description='The information about how the rule was created.'),
    tagKeyLogicScope?: string(name='TagKeyLogicScope', description='When retrieving details of rules created using the parameter `TagsScope`, this field will not be returned.

To retrieve rules created using the deprecated field `TagKeyScope` (not recommended): for example, when the parameter `TagKeyScope` has a value of ECS,OSS, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels ECS and OSS.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
    tagKeyScope?: string(name='TagKeyScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag key used to filter resources. The rule applies only to the resources with the specified tag key.', example='RAM', deprecated=true),
    tagValueScope?: string(name='TagValueScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag value used to filter resources. The rule applies only to the resources with the specified tag value.', example='MFA', deprecated=true),
    tags?: [ 
      {
        tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
        tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
      }
    ](name='Tags', description='The list of tags.'),
    tagsScope?: [ 
      {
        tagKey?: string(name='TagKey', description='The key of the tag.', example='key-1'),
        tagValue?: string(name='TagValue', description='The value of the tag.', example='value-1'),
      }
    ](name='TagsScope', description='The tag scope.'),
  }(name='ConfigRule', description='The information about the rules.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='811234F4-C3AB-4D15-B90B-F55016D1B5AA'),
}

model GetAggregateConfigRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateConfigRuleResponseBody(name='body'),
}

/**
 * @summary Queries the details of a rule in an account group.
 *
 * @description This example shows how to query the details of the `cr-7f7d626622af0041****` rule in the `ca-7f00626622af0041****` account group.
 *
 * @param tmpReq GetAggregateConfigRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateConfigRuleResponse
 */
async function getAggregateConfigRuleWithOptions(tmpReq: GetAggregateConfigRuleRequest, runtime: Util.RuntimeOptions): GetAggregateConfigRuleResponse {
  Util.validateModel(tmpReq);
  var request = new GetAggregateConfigRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateConfigRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a rule in an account group.
 *
 * @description This example shows how to query the details of the `cr-7f7d626622af0041****` rule in the `ca-7f00626622af0041****` account group.
 *
 * @param request GetAggregateConfigRuleRequest
 * @return GetAggregateConfigRuleResponse
 */
async function getAggregateConfigRule(request: GetAggregateConfigRuleRequest): GetAggregateConfigRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateConfigRuleWithOptions(request, runtime);
}

model GetAggregateConfigRuleComplianceByPackRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-04b3fd170e340007****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-541e626622af0087****'),
}

model GetAggregateConfigRuleComplianceByPackResponseBody = {
  configRuleComplianceResult?: {
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-541e626622af0087****'),
    configRuleCompliances?: [ 
      {
        complianceType?: string(name='ComplianceType', description='The compliance evaluation result returned by the rule. Valid values:

*   COMPLIANT: The relevant resources are evaluated as compliant.
*   NON_COMPLIANT: The relevant resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to your resources.
*   INSUFFICIENT_DATA: No resource data is available.', example='COMPLIANT'),
        configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-fdc8626622af00f9****'),
        configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='test-rule-name'),
      }
    ](name='ConfigRuleCompliances', description='The information about rules in the compliance package.'),
    nonCompliantCount?: int32(name='NonCompliantCount', description='The number of rules against which specific resources are evaluated as non-compliant.', example='0'),
    totalCount?: int32(name='TotalCount', description='The total number of rules in the compliance package.', example='1'),
  }(name='ConfigRuleComplianceResult', description='The compliance evaluation results that are returned by rules in the compliance package.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C6B0C0A8-3245-48F1-AEAB-BC1A446E99D0'),
}

model GetAggregateConfigRuleComplianceByPackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateConfigRuleComplianceByPackResponseBody(name='body'),
}

/**
 * @summary Queries compliance evaluation results based on the rules in a compliance package in an account group.
 *
 * @description The sample request in this topic shows you how to query the compliance evaluation results based on rules in the `cp-541e626622af0087****` compliance package that is created for the `ca-04b3fd170e340007****` account group. The return result shows a total of `one` rule. `No resources` are evaluated as non-compliant based on the rule.
 *
 * @param request GetAggregateConfigRuleComplianceByPackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateConfigRuleComplianceByPackResponse
 */
async function getAggregateConfigRuleComplianceByPackWithOptions(request: GetAggregateConfigRuleComplianceByPackRequest, runtime: Util.RuntimeOptions): GetAggregateConfigRuleComplianceByPackResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateConfigRuleComplianceByPack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries compliance evaluation results based on the rules in a compliance package in an account group.
 *
 * @description The sample request in this topic shows you how to query the compliance evaluation results based on rules in the `cp-541e626622af0087****` compliance package that is created for the `ca-04b3fd170e340007****` account group. The return result shows a total of `one` rule. `No resources` are evaluated as non-compliant based on the rule.
 *
 * @param request GetAggregateConfigRuleComplianceByPackRequest
 * @return GetAggregateConfigRuleComplianceByPackResponse
 */
async function getAggregateConfigRuleComplianceByPack(request: GetAggregateConfigRuleComplianceByPackRequest): GetAggregateConfigRuleComplianceByPackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateConfigRuleComplianceByPackWithOptions(request, runtime);
}

model GetAggregateConfigRuleSummaryByRiskLevelRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-3a58626622af0005****'),
}

model GetAggregateConfigRuleSummaryByRiskLevelResponseBody = {
  configRuleSummaries?: [ 
    {
      compliantCount?: int32(name='CompliantCount', description='The number of rules against which specific resources are evaluated as compliant.', example='3'),
      nonCompliantCount?: int32(name='NonCompliantCount', description='The number of rules against which specific resources are evaluated as non-compliant.', example='1'),
      riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
    }
  ](name='ConfigRuleSummaries', description='The summary of compliance evaluation results by rule risk level.'),
  requestId?: string(name='RequestId', description='The request ID.', example='A3CDD98C-DE65-46AC-B2D2-04A4A9AB5B73'),
}

model GetAggregateConfigRuleSummaryByRiskLevelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateConfigRuleSummaryByRiskLevelResponseBody(name='body'),
}

/**
 * @summary Queries the summary of compliance evaluation results by rule risk level in an account group.
 *
 * @description This topic provides an example on how to query the summary of compliance evaluation results by rule risk level in the `ca-3a58626622af0005****` account group. The returned result shows four rules that are specified with the high risk level. One of the rules detects non-compliant resources, and the resources evaluated by the remaining three are compliant.
 *
 * @param request GetAggregateConfigRuleSummaryByRiskLevelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateConfigRuleSummaryByRiskLevelResponse
 */
async function getAggregateConfigRuleSummaryByRiskLevelWithOptions(request: GetAggregateConfigRuleSummaryByRiskLevelRequest, runtime: Util.RuntimeOptions): GetAggregateConfigRuleSummaryByRiskLevelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateConfigRuleSummaryByRiskLevel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the summary of compliance evaluation results by rule risk level in an account group.
 *
 * @description This topic provides an example on how to query the summary of compliance evaluation results by rule risk level in the `ca-3a58626622af0005****` account group. The returned result shows four rules that are specified with the high risk level. One of the rules detects non-compliant resources, and the resources evaluated by the remaining three are compliant.
 *
 * @param request GetAggregateConfigRuleSummaryByRiskLevelRequest
 * @return GetAggregateConfigRuleSummaryByRiskLevelResponse
 */
async function getAggregateConfigRuleSummaryByRiskLevel(request: GetAggregateConfigRuleSummaryByRiskLevelRequest): GetAggregateConfigRuleSummaryByRiskLevelResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateConfigRuleSummaryByRiskLevelWithOptions(request, runtime);
}

model GetAggregateConfigRulesReportRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  reportId?: string(name='ReportId', description='The ID of the compliance evaluation report.', example='crp-88176457e0d900c9****'),
}

model GetAggregateConfigRulesReportResponseBody = {
  configRulesReport?: {
    accountId?: long(name='AccountId', description='The ID of the management account to which the rules belong.', example='100931896542****'),
    aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-f632626622af0079****'),
    reportCreateTimestamp?: long(name='ReportCreateTimestamp', description='The timestamp when the compliance evaluation report was generated. Unit: milliseconds.', example='1624332329593'),
    reportId?: string(name='ReportId', description='The ID of the compliance evaluation report.', example='crp-88176457e0d900c9****'),
    reportStatus?: string(name='ReportStatus', description='The status of the compliance evaluation report. Valid values:

*   NONE: The compliance evaluation report is not generated.
*   CREATING: The compliance evaluation report is being generated.
*   COMPLETE: The compliance evaluation report was generated.', example='CREATING'),
    reportUrl?: string(name='ReportUrl', description='The URL used to download the compliance evaluation report.'),
  }(name='ConfigRulesReport', description='The compliance evaluation report.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F0BCC7B2-D0E4-49B0-95D2-6689CFB08D31'),
}

model GetAggregateConfigRulesReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateConfigRulesReportResponseBody(name='body'),
}

/**
 * @summary Downloads the compliance evaluation report in the Excel format to your on-premises machine. This allows you to assign tasks and modify incompliant resource configurations.
 *
 * @description > Before you call this operation, you must call the GenerateAggregateConfigRulesReport operation to generate the latest compliance evaluation report based on all rules in an account group. For more information, see [GenerateAggregateConfigRulesReport](https://help.aliyun.com/document_detail/262701.html).
 * This topic provides an example on how to query the compliance evaluation report that is generated based on all rules in the `ca-f632626622af0079****` account group.
 *
 * @param request GetAggregateConfigRulesReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateConfigRulesReportResponse
 */
async function getAggregateConfigRulesReportWithOptions(request: GetAggregateConfigRulesReportRequest, runtime: Util.RuntimeOptions): GetAggregateConfigRulesReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateConfigRulesReport',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Downloads the compliance evaluation report in the Excel format to your on-premises machine. This allows you to assign tasks and modify incompliant resource configurations.
 *
 * @description > Before you call this operation, you must call the GenerateAggregateConfigRulesReport operation to generate the latest compliance evaluation report based on all rules in an account group. For more information, see [GenerateAggregateConfigRulesReport](https://help.aliyun.com/document_detail/262701.html).
 * This topic provides an example on how to query the compliance evaluation report that is generated based on all rules in the `ca-f632626622af0079****` account group.
 *
 * @param request GetAggregateConfigRulesReportRequest
 * @return GetAggregateConfigRulesReportResponse
 */
async function getAggregateConfigRulesReport(request: GetAggregateConfigRulesReportRequest): GetAggregateConfigRulesReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateConfigRulesReportWithOptions(request, runtime);
}

model GetAggregateDiscoveredResourceRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-5885626622af0008****'),
  complianceOption?: int32(name='ComplianceOption', description='Specifies whether to query the compliance results of the resource. Valid values:

*   0 (default): does not query the compliance results of the resource.
*   1: queries the compliance results of the resource.', example='0'),
  region?: string(name='Region', description='The ID of the region in which the resource resides.

For more information about how to query the ID of a region in which the resource resides, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/411691.html).

This parameter is required.', example='cn-hangzhou'),
  resourceAccountId?: long(name='ResourceAccountId', description='Required. The ID of the Alibaba Cloud account to which the specified resource belongs in the account group.', example='100931896542****'),
  resourceId?: string(name='ResourceId', description='The resource ID.

For more information about how to obtain the ID of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/411691.html).

This parameter is required.', example='new-bucket'),
  resourceOwnerId?: long(name='ResourceOwnerId', deprecated=true),
  resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to obtain the type of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/411691.html).

This parameter is required.', example='ACS::OSS::Bucket'),
}

model GetAggregateDiscoveredResourceResponseBody = {
  discoveredResourceDetail?: {
    accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
    availabilityZone?: string(name='AvailabilityZone', description='The ID of the zone in which the resource resides.', example='cn-hangzhou-h'),
    complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resource.
*   INSUFFICIENT_DATA: No data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='COMPLIANT'),
    configuration?: string(name='Configuration', description='The configuration of the resource.', example='{\\\\"AccessControlList\\\\":{\\\\"Grant\\\\":\\\\"private\\\\"},\\\\"ServerSideEncryptionRule\\\\":{\\\\"SSEAlgorithm\\\\":\\\\"None\\\\"},\\\\"Comment\\\\":\\\\"\\\\",\\\\"CreationDate\\\\":\\\\"2021-06-29T10:05:12.000Z\\\\",\\\\"Owner\\\\":{\\\\"DisplayName\\\\":\\\\"100931896542****\\\\",\\\\"ID\\\\":\\\\"100931896542****\\\\"},\\\\"StorageClass\\\\":\\\\"Standard\\\\",\\\\"DataRedundancyType\\\\":\\\\"LRS\\\\",\\\\"AllowEmptyReferer\\\\":\\\\"true\\\\",\\\\"Name\\\\":\\\\"new-bucket\\\\",\\\\"BucketPolicy\\\\":{\\\\"LogPrefix\\\\":\\\\"\\\\",\\\\"LogBucket\\\\":\\\\"\\\\"},\\\\"ExtranetEndpoint\\\\":\\\\"oss-cn-hangzhou.aliyuncs.com\\\\",\\\\"IntranetEndpoint\\\\":\\\\"oss-cn-hangzhou-internal.aliyuncs.com\\\\",\\\\"Location\\\\":\\\\"oss-cn-hangzhou\\\\"}'),
    region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
    resourceCreationTime?: long(name='ResourceCreationTime', description='The timestamp when the resource was created.', example='1624961112000'),
    resourceDeleted?: int32(name='ResourceDeleted', description='Indicates whether the resource was deleted. Valid values:

*   1: The resource was not deleted.
*   0: The resource was deleted.', example='1'),
    resourceId?: string(name='ResourceId', description='The resource ID.', example='new-bucket'),
    resourceName?: string(name='ResourceName', description='The name of the resource.', example='new-bucket'),
    resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The value of this parameter varies based on the resource type and may be empty.

*   If the ResourceType parameter is set to ACS::ECS::Instance, the resource is an ECS instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
*   If the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that is not in a specific state. In this case, this parameter is left empty.', example='offline'),
    resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::OSS::BucketACS::CDN::Domain'),
    tags?: string(name='Tags', description='The tags of the resource.', example='{\\\\"\\\\"hc\\\\"\\\\":[\\\\"\\\\"value2\\\\"\\\\"]}'),
  }(name='DiscoveredResourceDetail', description='The details of the resource.'),
  requestId?: string(name='RequestId', description='The request ID.', example='E4D71ACE-6B0A-46E0-8352-56952378CC7F'),
}

model GetAggregateDiscoveredResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateDiscoveredResourceResponseBody(name='body'),
}

/**
 * @summary Queries the details of a specific resource in an account group.
 *
 * @description This topic provides an example on how to query the details of an Elastic Compute Service (ECS) instance `i-bp12g4xbl4i0brkn****` that resides in the China (Hangzhou) region in the account group `ca-5885626622af0008****`.
 *
 * @param request GetAggregateDiscoveredResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateDiscoveredResourceResponse
 */
async function getAggregateDiscoveredResourceWithOptions(request: GetAggregateDiscoveredResourceRequest, runtime: Util.RuntimeOptions): GetAggregateDiscoveredResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.complianceOption)) {
    query['ComplianceOption'] = request.complianceOption;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateDiscoveredResource',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a specific resource in an account group.
 *
 * @description This topic provides an example on how to query the details of an Elastic Compute Service (ECS) instance `i-bp12g4xbl4i0brkn****` that resides in the China (Hangzhou) region in the account group `ca-5885626622af0008****`.
 *
 * @param request GetAggregateDiscoveredResourceRequest
 * @return GetAggregateDiscoveredResourceResponse
 */
async function getAggregateDiscoveredResource(request: GetAggregateDiscoveredResourceRequest): GetAggregateDiscoveredResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateDiscoveredResourceWithOptions(request, runtime);
}

model GetAggregateResourceComplianceByConfigRuleRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resources. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as incompliant.
*   NOT_APPLICABLE: The rule does not apply to your resources.
*   INSUFFICIENT_DATA: No resource data is available.', example='COMPLIANT'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-d369626622af008e****'),
  resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resources in the account group belong.

> You can use either the ResourceAccountId or ResourceOwnerId parameter. We recommend that you use the ResourceAccountId parameter.', example='100931896542****'),
  resourceOwnerId?: long(name='ResourceOwnerId', deprecated=true),
}

model GetAggregateResourceComplianceByConfigRuleResponseBody = {
  complianceResult?: {
    compliances?: [ 
      {
        complianceType?: string(name='ComplianceType', description='The compliance evaluation results of the resources. Valid values:

*   COMPLIANT: The resource was evaluated as compliant.
*   NON_COMPLIANT: The resource was evaluated as incompliant.
*   NOT_APPLICABLE: The rule did not apply to your resources.
*   INSUFFICIENT_DATA: No resource data was available.', example='COMPLIANT'),
        count?: int32(name='Count', description='The number of resources that have compliance evaluation results. For example, if the value of the `ComplianceType` parameter is `COMPLIANT`, this parameter value indicates the number of compliant resources.', example='3'),
      }
    ](name='Compliances', description='The compliance list result.'),
    totalCount?: long(name='TotalCount', description='The total number of evaluated resources.', example='5'),
  }(name='ComplianceResult', description='The compliance result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='23306AB1-34E0-468F-BD7B-68D8AEAB754C'),
}

model GetAggregateResourceComplianceByConfigRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceComplianceByConfigRuleResponseBody(name='body'),
}

/**
 * @summary Queries compliance evaluation results based on the rules in a compliance package in an account group.
 *
 * @description This topic provides an example on how to query the compliance evaluation results based on the `cr-d369626622af008e****` rule in the `ca-a4e5626622af0079****` account group. The returned result shows that a total of 10 resources are evaluated by the rule and five of them are evaluated as compliant.
 *
 * @param request GetAggregateResourceComplianceByConfigRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceComplianceByConfigRuleResponse
 */
async function getAggregateResourceComplianceByConfigRuleWithOptions(request: GetAggregateResourceComplianceByConfigRuleRequest, runtime: Util.RuntimeOptions): GetAggregateResourceComplianceByConfigRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.complianceType)) {
    query['ComplianceType'] = request.complianceType;
  }
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceComplianceByConfigRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries compliance evaluation results based on the rules in a compliance package in an account group.
 *
 * @description This topic provides an example on how to query the compliance evaluation results based on the `cr-d369626622af008e****` rule in the `ca-a4e5626622af0079****` account group. The returned result shows that a total of 10 resources are evaluated by the rule and five of them are evaluated as compliant.
 *
 * @param request GetAggregateResourceComplianceByConfigRuleRequest
 * @return GetAggregateResourceComplianceByConfigRuleResponse
 */
async function getAggregateResourceComplianceByConfigRule(request: GetAggregateResourceComplianceByConfigRuleRequest): GetAggregateResourceComplianceByConfigRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceComplianceByConfigRuleWithOptions(request, runtime);
}

model GetAggregateResourceComplianceByPackRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-fdc8626622af00f9****'),
}

model GetAggregateResourceComplianceByPackResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
  resourceComplianceResult?: {
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-fdc8626622af00f9****'),
    nonCompliantCount?: int32(name='NonCompliantCount', description='The number of non-compliant resources.', example='7'),
    totalCount?: int32(name='TotalCount', description='The total number of resources.', example='10'),
  }(name='ResourceComplianceResult', description='The compliance evaluation results returned.'),
}

model GetAggregateResourceComplianceByPackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceComplianceByPackResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation results of resources evaluated based on a compliance package of an account group.
 *
 * @description This topic provides an example on how to query the compliance evaluation results of resources monitored based on the `cp-fdc8626622af00f9****` compliance package in the `ca-f632626622af0079****`account group. The returned result shows that the total number of monitored resources is `10` and the number of non-compliant resources is `7`.
 *
 * @param request GetAggregateResourceComplianceByPackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceComplianceByPackResponse
 */
async function getAggregateResourceComplianceByPackWithOptions(request: GetAggregateResourceComplianceByPackRequest, runtime: Util.RuntimeOptions): GetAggregateResourceComplianceByPackResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceComplianceByPack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation results of resources evaluated based on a compliance package of an account group.
 *
 * @description This topic provides an example on how to query the compliance evaluation results of resources monitored based on the `cp-fdc8626622af00f9****` compliance package in the `ca-f632626622af0079****`account group. The returned result shows that the total number of monitored resources is `10` and the number of non-compliant resources is `7`.
 *
 * @param request GetAggregateResourceComplianceByPackRequest
 * @return GetAggregateResourceComplianceByPackResponse
 */
async function getAggregateResourceComplianceByPack(request: GetAggregateResourceComplianceByPackRequest): GetAggregateResourceComplianceByPackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceComplianceByPackWithOptions(request, runtime);
}

model GetAggregateResourceComplianceGroupByRegionRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-d6c9626622af0052****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).', example='cr-2652626622af005e****'),
}

model GetAggregateResourceComplianceGroupByRegionResponseBody = {
  complianceResult?: {
    complianceResultList?: [ 
      {
        compliances?: [ 
          {
            complianceType?: string(name='ComplianceType', description='The evaluation result. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resource.
*   INSUFFICIENT_DATA: No data is available.', example='COMPLIANT'),
            count?: long(name='Count', description='The total number of evaluation results.', example='1'),
          }
        ](name='Compliances', description='The queried evaluation results.'),
        regionId?: string(name='RegionId', description='The region ID of the evaluated resource.', example='cn-beijing'),
      }
    ](name='ComplianceResultList', description='The evaluation results grouped by region.'),
  }(name='ComplianceResult', description='The queried evaluation results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5E3A847A-5D40-54A1-A2CE-77A87823ED07'),
}

model GetAggregateResourceComplianceGroupByRegionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceComplianceGroupByRegionResponseBody(name='body'),
}

/**
 * @summary Queries the evaluation results grouped by resource type for an account group rule.
 *
 * @param request GetAggregateResourceComplianceGroupByRegionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceComplianceGroupByRegionResponse
 */
async function getAggregateResourceComplianceGroupByRegionWithOptions(request: GetAggregateResourceComplianceGroupByRegionRequest, runtime: Util.RuntimeOptions): GetAggregateResourceComplianceGroupByRegionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceComplianceGroupByRegion',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the evaluation results grouped by resource type for an account group rule.
 *
 * @param request GetAggregateResourceComplianceGroupByRegionRequest
 * @return GetAggregateResourceComplianceGroupByRegionResponse
 */
async function getAggregateResourceComplianceGroupByRegion(request: GetAggregateResourceComplianceGroupByRegionRequest): GetAggregateResourceComplianceGroupByRegionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceComplianceGroupByRegionWithOptions(request, runtime);
}

model GetAggregateResourceComplianceGroupByResourceTypeRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-cdbd626622af0042****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The ID of the rule. Separate multiple rule IDs with commas (,).', example='cr-2541626622af0000****'),
}

model GetAggregateResourceComplianceGroupByResourceTypeResponseBody = {
  complianceResult?: {
    complianceResultList?: [ 
      {
        compliances?: [ 
          {
            complianceType?: string(name='ComplianceType', description='The evaluation result. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resource.
*   INSUFFICIENT_DATA: No data is available.', example='COMPLIANT'),
            count?: long(name='Count', description='The number of statistical results.', example='1'),
          }
        ](name='Compliances', description='The queried evaluation results.'),
        resourceType?: string(name='ResourceType', description='The type of the evaluated resource.', example='ACS::ECS::Instance'),
      }
    ](name='ComplianceResultList', description='The evaluation results grouped by resource type.'),
  }(name='ComplianceResult', description='The queried evaluation results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0CE6AEE1-B3D8-530A-9302-6606B20503BB'),
}

model GetAggregateResourceComplianceGroupByResourceTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceComplianceGroupByResourceTypeResponseBody(name='body'),
}

/**
 * @summary Queries the evaluation results grouped by resource type for an account group rule.
 *
 * @param request GetAggregateResourceComplianceGroupByResourceTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceComplianceGroupByResourceTypeResponse
 */
async function getAggregateResourceComplianceGroupByResourceTypeWithOptions(request: GetAggregateResourceComplianceGroupByResourceTypeRequest, runtime: Util.RuntimeOptions): GetAggregateResourceComplianceGroupByResourceTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceComplianceGroupByResourceType',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the evaluation results grouped by resource type for an account group rule.
 *
 * @param request GetAggregateResourceComplianceGroupByResourceTypeRequest
 * @return GetAggregateResourceComplianceGroupByResourceTypeResponse
 */
async function getAggregateResourceComplianceGroupByResourceType(request: GetAggregateResourceComplianceGroupByResourceTypeRequest): GetAggregateResourceComplianceGroupByResourceTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceComplianceGroupByResourceTypeWithOptions(request, runtime);
}

model GetAggregateResourceComplianceTimelineRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-5885626622af0008****'),
  endTime?: long(name='EndTime', description='The end of the time range to query. The default value indicates the time when the GetAggregateResourceConfigurationTimeline operation is called. Unit: milliseconds.', example='1625821156000'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned for a single request. Valid values: 1 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The `token` that is used to initiate the next request if the response of the current request is truncated. You can use the token to initiate another request and obtain the remaining records.', example='5OVS5J4I1/UKTkHV5oNs****'),
  region?: string(name='Region', description='The ID of the region where the resource resides.

For more information about how to obtain the ID of a region, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='cn-hangzhou'),
  resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resources in the account group belong.

> You can use either the ResourceAccountId or ResourceOwnerId parameter. We recommend that you use the ResourceAccountId parameter.', example='100931896542****'),
  resourceId?: string(name='ResourceId', description='The resource ID.

For more information about how to query the ID of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='new-bucket'),
  resourceOwnerId?: long(name='ResourceOwnerId', deprecated=true),
  resourceType?: string(name='ResourceType', description='The resource type.

For more information about how to obtain the type of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='ACS::OSS::Bucket'),
  startTime?: long(name='StartTime', description='The beginning of the time range to query. By default, Cloud Config retrieves the configuration changes in the last 30 days for the specified resource. Unit: milliseconds.', example='1623211156000'),
}

model GetAggregateResourceComplianceTimelineResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='8D53A78F-1EB8-4264-A554-72F07E34FAE6'),
  resourceComplianceTimeline?: {
    complianceList?: [ 
      {
        accountId?: string(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
        availabilityZone?: string(name='AvailabilityZone', description='The ID of the zone in which the resource resides.', example='cn-hangzhou-f'),
        captureTime?: long(name='CaptureTime', description='The timestamp when the compliance evaluation was recorded. Unit: milliseconds.', example='1625200295276'),
        configuration?: string(name='Configuration', description='The information about the rules that evaluated the resource and the compliance evaluation result.', example='{
    "AccessControlList": {
        "Grant": "private"
    },
    "ServerSideEncryptionRule": {
        "SSEAlgorithm": "None"
    },
    "Comment": "",
    "Owner": {
        "DisplayName": "126672004088****",
        "ID": "126672004088****"
    },
    "ResourceGroupId": "rg-acfmy4dfoau****",
    "StorageClass": "Standard",
    "DataRedundancyType": "LRS",
    "AllowEmptyReferer": "true",
    "Name": "test-private-oss****",
    "BucketPolicy": {
        "LogPrefix": "",
        "LogBucket": ""
    },
    "ExtranetEndpoint": "oss-cn-hangzhou.aliyuncs.com",
    "IntranetEndpoint": "oss-cn-hangzhou-internal.aliyuncs.com",
    "Location": "oss-cn-hangzhou"
}'),
        configurationDiff?: string(name='ConfigurationDiff', description='The details of the resource change that triggered the compliance evaluation.', example='{
    "ResourceGroupId": [
        "rg-acfmy4dfoau****",
        "rg-a3dmy4lksta****"
    ]
}'),
        region?: string(name='Region', description='The ID of the region in which the resource resides.', example='cn-hangzhou'),
        resourceCreateTime?: long(name='ResourceCreateTime', description='The timestamp when the resource was created. Unit: milliseconds.', example='1624961112000'),
        resourceId?: string(name='ResourceId', description='The ID of the resource.', example='test-private-oss****'),
        resourceName?: string(name='ResourceName', description='The name of the resource.', example='test-private-oss****'),
        resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The parameter value varies based on the resource type and may be left empty. Examples:

*   If the ResourceType parameter is set to ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
*   If the ResourceType parameter is set to ACS::OSS::Bucket, the resource is an OSS bucket that does not have a specific state. In this case, this parameter is left empty.', example='Running'),
        resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::OSS::Bucket'),
        tags?: string(name='Tags', description='The tags of the resource.', example='{\\\\"\\\\"hc\\\\"\\\\":[\\\\"\\\\"value2\\\\"\\\\"]}'),
      }
    ](name='ComplianceList', description='The status of the resource. The parameter value varies based on the resource type and may be left empty. Examples:

*   If the value of the ResourceType parameter is ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
*   If the value of the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that is not in a specific state. In this case, this parameter is empty.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned for a single request.', example='10'),
    nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='5OVS5J4I1/UKTkHV5oNs****'),
  }(name='ResourceComplianceTimeline', description='The information about the compliance timeline.'),
}

model GetAggregateResourceComplianceTimelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceComplianceTimelineResponseBody(name='body'),
}

/**
 * @summary Queries the compliance timeline of a resource in an account group.
 *
 * @description The sample request in this topic shows you how to query the compliance timeline of the `new-bucket` resource that resides in the `cn-hangzhou` region within the `100931896542****` member account of the `ca-5885626622af0008****` account group. The new-bucket resource is an Object Storage Service (OSS) bucket. The return result shows the following two timestamps on the compliance timeline: `1625200295276` and `1625200228510`. The first timestamp indicates 12:31:35 on July 2, 2021 (UTC+8), and the second timestamp indicates 12:30:28 on July 2, 2021 (UTC+8).
 *
 * @param request GetAggregateResourceComplianceTimelineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceComplianceTimelineResponse
 */
async function getAggregateResourceComplianceTimelineWithOptions(request: GetAggregateResourceComplianceTimelineRequest, runtime: Util.RuntimeOptions): GetAggregateResourceComplianceTimelineResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceComplianceTimeline',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance timeline of a resource in an account group.
 *
 * @description The sample request in this topic shows you how to query the compliance timeline of the `new-bucket` resource that resides in the `cn-hangzhou` region within the `100931896542****` member account of the `ca-5885626622af0008****` account group. The new-bucket resource is an Object Storage Service (OSS) bucket. The return result shows the following two timestamps on the compliance timeline: `1625200295276` and `1625200228510`. The first timestamp indicates 12:31:35 on July 2, 2021 (UTC+8), and the second timestamp indicates 12:30:28 on July 2, 2021 (UTC+8).
 *
 * @param request GetAggregateResourceComplianceTimelineRequest
 * @return GetAggregateResourceComplianceTimelineResponse
 */
async function getAggregateResourceComplianceTimeline(request: GetAggregateResourceComplianceTimelineRequest): GetAggregateResourceComplianceTimelineResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceComplianceTimelineWithOptions(request, runtime);
}

model GetAggregateResourceConfigurationTimelineRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-5885626622af0008****'),
  endTime?: long(name='EndTime', description='The end of the time range to query. The default value indicates the time when the GetAggregateResourceConfigurationTimeline operation is called. Unit: milliseconds.', example='1625821156000'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 1 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The `token` that is used to initiate the next request if the response of the current request is truncated. You can use the token to initiate another request and obtain the remaining records.', example='IWBjqMYSy0is7zSMGu16****'),
  region?: string(name='Region', description='The ID of the region in which the resource resides.

For more information about how to obtain the ID of a region, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='cn-hangzhou'),
  resourceAccountId?: long(name='ResourceAccountId', description='Required. The ID of the Alibaba Cloud account to which the specified resource belongs in the account group.', example='100931896542****'),
  resourceId?: string(name='ResourceId', description='The resource ID.

For more information about how to query the ID of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='new-bucket'),
  resourceOwnerId?: long(name='ResourceOwnerId', deprecated=true),
  resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to obtain the type of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='ACS::OSS::Bucket'),
  startTime?: long(name='StartTime', description='The beginning of the time range to query. By default, Cloud Config retrieves the configuration changes in the last 30 days for the specified resource. Unit: milliseconds.', example='1623211156000'),
}

model GetAggregateResourceConfigurationTimelineResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='ED9CD1B3-286C-4E05-A765-5E1E0B9BC2AB'),
  resourceConfigurationTimeline?: {
    configurationList?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
        availabilityZone?: string(name='AvailabilityZone', description='The ID of the zone in which the resource resides.', example='cn-hangzhou-h'),
        captureTime?: string(name='CaptureTime', description='The timestamp when the resource change snapshot was recorded. Unit: milliseconds.', example='1624961156000'),
        configurationDiff?: string(name='ConfigurationDiff', description='The details of the resource change that triggered the compliance evaluation.', example='{\\\\"AccessControlList\\\\":[null,{\\\\"Grant\\\\":\\\\"private\\\\"}],\\\\"ServerSideEncryptionRule\\\\":[null,{\\\\"SSEAlgorithm\\\\":\\\\"None\\\\"}],\\\\"CreationDate\\\\":[null,\\\\"2021-06-29T10:05:12.000Z\\\\"],\\\\"Owner\\\\":[null,{\\\\"DisplayName\\\\":\\\\"100931896542****\\\\",\\\\"ID\\\\":\\\\"100931896542****\\\\"}],\\\\"BucketPolicy\\\\":[null,{\\\\"LogPrefix\\\\":\\\\"\\\\",\\\\"LogBucket\\\\":\\\\"\\\\"}],\\\\"StorageClass\\\\":[null,\\\\"Standard\\\\"],\\\\"ExtranetEndpoint\\\\":[null,\\\\"oss-cn-hangzhou.aliyuncs.com\\\\"],\\\\"DataRedundancyType\\\\":[null,\\\\"LRS\\\\"],\\\\"AllowEmptyReferer\\\\":[null,\\\\"true\\\\"],\\\\"IntranetEndpoint\\\\":[null,\\\\"oss-cn-hangzhou-internal.aliyuncs.com\\\\"],\\\\"Name\\\\":[null,\\\\"new-bucket\\\\"],\\\\"Location\\\\":[null,\\\\"oss-cn-hangzhou\\\\"]}'),
        region?: string(name='Region', description='The ID of the region in which the resource resides.', example='cn-hangzhou'),
        resourceCreateTime?: string(name='ResourceCreateTime', description='The timestamp when the resource was created. Unit: milliseconds.', example='1624961112000'),
        resourceEventType?: string(name='ResourceEventType', description='The type of the resource change event involved. Valid values:

*   DISCOVERED: A resource is created.
*   DISCOVERED_REVISED: A resource is created by periodic remediation tasks.
*   MODIFY: A resource is modified.
*   MODIFY_REVISED: A resource is modified by periodic remediation tasks.
*   REMOVE: A resource is deleted.

> 
*   To ensure the integrity of resources, periodic remediation tasks are run to check data and generate events that indicate the creation of new resources. Such events are infrequent.
*   The time when a resource change event is generated by a periodic remediation task is considered as the detection time of Cloud Config. The detection time is later than the time when the resource is modified.', example='DISCOVERED'),
        resourceId?: string(name='ResourceId', description='The ID of the resource.', example='new-bucket'),
        resourceName?: string(name='ResourceName', description='The name of the resource.', example='new-bucket'),
        resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::OSS::Bucket'),
        tags?: string(name='Tags', description='The tags of the resource.', example='{\\\\"\\\\"hc\\\\"\\\\":[\\\\"\\\\"value2\\\\"\\\\"]}'),
      }
    ](name='ConfigurationList', description='The resource name.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned for a single request.', example='10'),
    nextToken?: string(name='NextToken', description='The token that is used to initiate the next request.', example='IWBjqMYSy0is7zSMGu16****'),
  }(name='ResourceConfigurationTimeline', description='The configuration timeline of the resource.'),
}

model GetAggregateResourceConfigurationTimelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceConfigurationTimelineResponseBody(name='body'),
}

/**
 * @summary Queries the configuration timeline of a resource in an account group.
 *
 * @description The sample request in this topic shows you how to query the configuration timeline of the `new-bucket` resource that resides in the `cn-hangzhou` region within the `100931896542****` member account of the `ca-5885626622af0008****` account group. The new-bucket resource is an Object Storage Service (OSS) bucket. The return result shows that the timestamp when the resource configuration changes is `1624961112000`. The timestamp indicates 18:05:12 on June 29, 2021 (UTC+8).
 *
 * @param request GetAggregateResourceConfigurationTimelineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceConfigurationTimelineResponse
 */
async function getAggregateResourceConfigurationTimelineWithOptions(request: GetAggregateResourceConfigurationTimelineRequest, runtime: Util.RuntimeOptions): GetAggregateResourceConfigurationTimelineResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceConfigurationTimeline',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configuration timeline of a resource in an account group.
 *
 * @description The sample request in this topic shows you how to query the configuration timeline of the `new-bucket` resource that resides in the `cn-hangzhou` region within the `100931896542****` member account of the `ca-5885626622af0008****` account group. The new-bucket resource is an Object Storage Service (OSS) bucket. The return result shows that the timestamp when the resource configuration changes is `1624961112000`. The timestamp indicates 18:05:12 on June 29, 2021 (UTC+8).
 *
 * @param request GetAggregateResourceConfigurationTimelineRequest
 * @return GetAggregateResourceConfigurationTimelineResponse
 */
async function getAggregateResourceConfigurationTimeline(request: GetAggregateResourceConfigurationTimelineRequest): GetAggregateResourceConfigurationTimelineResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceConfigurationTimelineWithOptions(request, runtime);
}

model GetAggregateResourceCountsGroupByRegionRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a260626622af0005****'),
  folderId?: string(name='FolderId', description='The ID of the folder in the resource directory. For more information about how to obtain the ID of a folder, see [View the basic information of a folder](https://help.aliyun.com/document_detail/111223.html).', example='r-BU****'),
  resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resources in the account group belong.

> You can use either the ResourceAccountId or ResourceOwnerId parameter. We recommend that you use the ResourceAccountId parameter.', example='100931896542****'),
  resourceOwnerId?: long(name='ResourceOwnerId', deprecated=true),
  resourceType?: string(name='ResourceType', description='The resource type.

For more information about how to obtain the type of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).', example='ACS::ECS::Instance'),
}

model GetAggregateResourceCountsGroupByRegionResponseBody = {
  discoveredResourceCountsSummary?: [ 
    {
      groupName?: string(name='GroupName', description='The dimension by which statistics are collected.

>  In most cases, the `Region` parameter is returned instead of the GroupName parameter.', example='cn-hangzhou'),
      region?: string(name='Region', description='The ID of the region by which statistics are collected.', example='cn-hangzhou'),
      resourceCount?: long(name='ResourceCount', description='The total number of resources in the region.', example='10'),
    }
  ](name='DiscoveredResourceCountsSummary', description='The ID of the region by which statistics are collected.'),
  requestId?: string(name='RequestId', description='The request ID.', example='399BD94C-D20C-4D27-88D4-89E8D75C0595'),
}

model GetAggregateResourceCountsGroupByRegionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceCountsGroupByRegionResponseBody(name='body'),
}

/**
 * @summary Queries the statistics on the resources in an account group by region.
 *
 * @description This topic provides an example on how to query the statistics on the resources in an account group named `ca-a260626622af0005****` by region. The returned result shows that a total of `10` resources exist in the `cn-hangzhou` region.
 *
 * @param request GetAggregateResourceCountsGroupByRegionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceCountsGroupByRegionResponse
 */
async function getAggregateResourceCountsGroupByRegionWithOptions(request: GetAggregateResourceCountsGroupByRegionRequest, runtime: Util.RuntimeOptions): GetAggregateResourceCountsGroupByRegionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.folderId)) {
    query['FolderId'] = request.folderId;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceCountsGroupByRegion',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics on the resources in an account group by region.
 *
 * @description This topic provides an example on how to query the statistics on the resources in an account group named `ca-a260626622af0005****` by region. The returned result shows that a total of `10` resources exist in the `cn-hangzhou` region.
 *
 * @param request GetAggregateResourceCountsGroupByRegionRequest
 * @return GetAggregateResourceCountsGroupByRegionResponse
 */
async function getAggregateResourceCountsGroupByRegion(request: GetAggregateResourceCountsGroupByRegionRequest): GetAggregateResourceCountsGroupByRegionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceCountsGroupByRegionWithOptions(request, runtime);
}

model GetAggregateResourceCountsGroupByResourceTypeRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a260626622af0005****'),
  folderId?: string(name='FolderId', description='The ID of the folder in the resource directory.

For more information about how to obtain the ID of a folder, see [View the basic information of a folder](https://help.aliyun.com/document_detail/111223.html).', example='r-BU****'),
  region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
  resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resources in the account group belong.

> You can specify either the ResourceAccountId or ResourceOwnerId parameter. We recommend that you specify the ResourceAccountId parameter.', example='100931896542****'),
  resourceOwnerId?: long(name='ResourceOwnerId', deprecated=true),
}

model GetAggregateResourceCountsGroupByResourceTypeResponseBody = {
  discoveredResourceCountsSummary?: [ 
    {
      groupName?: string(name='GroupName', description='This parameter is expired. The resource type by which statistics are collected.', example='ACS::RAM::Role'),
      resourceCount?: long(name='ResourceCount', description='The total number of resources in the region.', example='7'),
      resourceType?: string(name='ResourceType', description='The resource type by which statistics are collected.', example='ACS::RAM::Role'),
    }
  ](name='DiscoveredResourceCountsSummary', description='The resource type by which the statistics are collected.'),
  requestId?: string(name='RequestId', description='The request ID.', example='99114B22-1EFF-47DF-B906-1CCE82FF9D60'),
}

model GetAggregateResourceCountsGroupByResourceTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceCountsGroupByResourceTypeResponseBody(name='body'),
}

/**
 * @summary Queries the statistics on the resources in an account group by resource type.
 *
 * @description This topic provides an example on how to query the statistics on the resources in an account group whose ID is `ca-a260626622af0005****` by resource type. The returned result shows that the account group has a total of `seven` resources of the `ACS::RAM::Role` resource type.
 *
 * @param request GetAggregateResourceCountsGroupByResourceTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceCountsGroupByResourceTypeResponse
 */
async function getAggregateResourceCountsGroupByResourceTypeWithOptions(request: GetAggregateResourceCountsGroupByResourceTypeRequest, runtime: Util.RuntimeOptions): GetAggregateResourceCountsGroupByResourceTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.folderId)) {
    query['FolderId'] = request.folderId;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceCountsGroupByResourceType',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics on the resources in an account group by resource type.
 *
 * @description This topic provides an example on how to query the statistics on the resources in an account group whose ID is `ca-a260626622af0005****` by resource type. The returned result shows that the account group has a total of `seven` resources of the `ACS::RAM::Role` resource type.
 *
 * @param request GetAggregateResourceCountsGroupByResourceTypeRequest
 * @return GetAggregateResourceCountsGroupByResourceTypeResponse
 */
async function getAggregateResourceCountsGroupByResourceType(request: GetAggregateResourceCountsGroupByResourceTypeRequest): GetAggregateResourceCountsGroupByResourceTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceCountsGroupByResourceTypeWithOptions(request, runtime);
}

model GetAggregateResourceInventoryRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a91d626622af0035****'),
}

model GetAggregateResourceInventoryResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1A6D3604-EF1A-5798-A576-2A5FB855493C'),
  resourceInventory?: {
    downloadUrl?: string(name='DownloadUrl', description='The download URL of the resource inventory.'),
    resourceInventoryGenerateTime?: long(name='ResourceInventoryGenerateTime', description='The time when the resource inventory was generated. The value is a timestamp.

Unit: milliseconds.', example='1687674774123'),
    status?: string(name='Status', description='The generation status of the resource inventory. Valid values:

*   CREATING: The resource inventory is being generated.
*   COMPLETE: The resource inventory is generated.', example='COMPLETE'),
  }(name='ResourceInventory', description='The information about the resource inventory.'),
}

model GetAggregateResourceInventoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregateResourceInventoryResponseBody(name='body'),
}

/**
 * @summary Obtains the last resource inventory that is generated on the Global Resources page within the current account group.
 *
 * @description ### [](#)Prerequisites
 * The [GenerateAggregateResourceInventory](https://help.aliyun.com/document_detail/2398353.html) operation is called to generate a resource inventory. Then, this operation is called to obtain the URL of the resource inventory.
 * ### [](#)Description
 * This topic provides an example on how to obtain the last resource inventory that is generated within the account group ca-a91d626622af0035\\*\\*\\*\\*.
 *
 * @param request GetAggregateResourceInventoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregateResourceInventoryResponse
 */
async function getAggregateResourceInventoryWithOptions(request: GetAggregateResourceInventoryRequest, runtime: Util.RuntimeOptions): GetAggregateResourceInventoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregateResourceInventory',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the last resource inventory that is generated on the Global Resources page within the current account group.
 *
 * @description ### [](#)Prerequisites
 * The [GenerateAggregateResourceInventory](https://help.aliyun.com/document_detail/2398353.html) operation is called to generate a resource inventory. Then, this operation is called to obtain the URL of the resource inventory.
 * ### [](#)Description
 * This topic provides an example on how to obtain the last resource inventory that is generated within the account group ca-a91d626622af0035\\*\\*\\*\\*.
 *
 * @param request GetAggregateResourceInventoryRequest
 * @return GetAggregateResourceInventoryResponse
 */
async function getAggregateResourceInventory(request: GetAggregateResourceInventoryRequest): GetAggregateResourceInventoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregateResourceInventoryWithOptions(request, runtime);
}

model GetAggregatorRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-88ea626622af0055****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.

You can specify at most 20 tag keys.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetAggregatorShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-88ea626622af0055****'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetAggregatorResponseBody = {
  aggregator?: {
    accountId?: long(name='AccountId', description='The ID of the management account that is used to create the account group.', example='100931896542****'),
    aggregatorAccountCount?: long(name='AggregatorAccountCount', description='The number of members in the account group.', example='2'),
    aggregatorAccounts?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the member.', example='171322098523****'),
        accountName?: string(name='AccountName', description='The display name of the member.', example='Alice', nullable=false),
        accountType?: string(name='AccountType', description='The resource directory to which the member belongs. Valid value: ResourceDirectory. ResourceDirectory indicates that the member belongs to a resource directory.', example='ResourceDirectory'),
        recorderStatus?: string(name='RecorderStatus', description='The status of the configuration recorder for the member. Valid values:

*   REGISTRABLE: The configuration recorder is not registered.
*   BUILDING: The configuration recorder is being deployed.
*   REGISTERED: The configuration recorder is registered.
*   REBUILDING: The configuration recorder is being redeployed.', example='REGISTERED'),
      }
    ](name='AggregatorAccounts', description='The information about the members in the account group.'),
    aggregatorCreateTimestamp?: string(name='AggregatorCreateTimestamp', description='The timestamp generated when the account group was created.

Unit: milliseconds.', example='1623034091000'),
    aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-88ea626622af0055****'),
    aggregatorName?: string(name='AggregatorName', description='The name of the account group.', example='Test-Group'),
    aggregatorStatus?: int32(name='AggregatorStatus', description='The status of the account group. Valid values:

*   0: The account group is being created.
*   1: The account group was created.', example='1'),
    aggregatorType?: string(name='AggregatorType', description='The type of the account group. Valid values:

*   RD: a global account group.
*   FOLDER: an account group for a folder.
*   CUSTOM: a custom account group.', example='CUSTOM'),
    description?: string(name='Description', description='The description of the account group.', example='The description of the test account group.'),
    folderId?: string(name='FolderId', description='The ID of the attached folder of the account group.', example='fd-brHdgv****'),
    tags?: [ 
      {
        tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
        tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
      }
    ](name='Tags', description='tags'),
  }(name='Aggregator', description='The details of the account group.'),
  requestId?: string(name='RequestId', description='The request ID.', example='733DD93C-2277-4905-AE0C-0BA95C04B8BC'),
}

model GetAggregatorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAggregatorResponseBody(name='body'),
}

/**
 * @summary Queries the details of an account group. You can query the name, creation time, member, and type of an account group.
 *
 * @description The sample request in this topic shows you how to query the details of the `ca-88ea626622af0055****` account group. The return result shows that the account group is named `Test_Group`, its description is `Test account group`, and it is of the `CUSTOM` type. The account group is in the `1` state, which indicates that it is created.
 *
 * @param tmpReq GetAggregatorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAggregatorResponse
 */
async function getAggregatorWithOptions(tmpReq: GetAggregatorRequest, runtime: Util.RuntimeOptions): GetAggregatorResponse {
  Util.validateModel(tmpReq);
  var request = new GetAggregatorShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAggregator',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an account group. You can query the name, creation time, member, and type of an account group.
 *
 * @description The sample request in this topic shows you how to query the details of the `ca-88ea626622af0055****` account group. The return result shows that the account group is named `Test_Group`, its description is `Test account group`, and it is of the `CUSTOM` type. The account group is in the `1` state, which indicates that it is created.
 *
 * @param request GetAggregatorRequest
 * @return GetAggregatorResponse
 */
async function getAggregator(request: GetAggregatorRequest): GetAggregatorResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAggregatorWithOptions(request, runtime);
}

model GetCompliancePackRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-a8a8626622af0082****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.

You can specify at most 20 tag keys.', example='key-1'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 256 characters in length and cannot contain `http://` or `https://`.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetCompliancePackShrinkRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-a8a8626622af0082****'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetCompliancePackResponseBody = {
  compliancePack?: {
    accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the compliance package belongs.', example='100931896542****'),
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-a8a8626622af0082****'),
    compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='example-pack-name'),
    compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template.', example='ct-5f26ff4e06a300c4****'),
    configRules?: [ 
      {
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-a260626622af0005****'),
        configRuleName?: string(name='ConfigRuleName', description='The rule name.', example='eip-bandwidth-limit'),
        configRuleParameters?: [ 
          {
            parameterName?: string(name='ParameterName', description='The name of the input parameter.', example='bandwidth'),
            parameterValue?: string(name='ParameterValue', description='The value of the input parameter.', example='10'),
            required?: boolean(name='Required', description='Indicates whether the input parameters are required. Valid values:

*   true
*   false', example='true'),
          }
        ](name='ConfigRuleParameters', description='The input parameters of the rule.'),
        description?: string(name='Description', description='The rule description.', example='example-description'),
        managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The identifier of the managed rule.', example='eip-bandwidth-limit'),
        resourceTypesScope?: string(name='ResourceTypesScope', description='The type of the resource evaluated based on the rule. Separate multiple resource types with commas (,).', example='ACS::EIP::EipAddress'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
      }
    ](name='ConfigRules', description='The rules in the compliance package.'),
    createTimestamp?: long(name='CreateTimestamp', description='The timestamp when the compliance package was created. Unit: milliseconds.', example='1624245766000'),
    description?: string(name='Description', description='The description of the compliance package.', example='example-name'),
    riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
    scope?: {
      excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of regions that are excluded. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
      excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups whose resources you do not want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzc7r7rhx****'),
      excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package.', example='eip-8vbf3x310fn56ijfd****'),
      excludeTagsScope?: [ 
        {
          tagKey?: string(name='TagKey', description='The key of the tag.', example='key-2'),
          tagValue?: string(name='TagValue', description='The value of the tag.', example='value-2'),
        }
      ](name='ExcludeTagsScope', description='The scope of the tag that is excluded.

This parameter is required.'),
      regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package.', example='cn-hangzhou'),
      resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package.', example='rg-aekzc7r7rhx****'),
      resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources to which the rule applies. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
      tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
      tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.', example='test'),
      tagsScope?: [ 
        {
          tagKey?: string(name='TagKey', description='The key of the tag.', example='key-1'),
          tagValue?: string(name='TagValue', description='The value of the tag.', example='value-1'),
        }
      ](name='TagsScope', description='The tag scope.

This parameter is required.'),
    }(name='Scope', description='The resource group for which the compliance package took effect.'),
    status?: string(name='Status', description='The status of the compliance package. Valid values:

*   ACTIVE: The compliance package is normal.
*   CREATING: The compliance package is being created.', example='ACTIVE'),
    tags?: [ 
      {
        tagKey?: string(name='TagKey', description='The tag keys of the resource.', example='key-1'),
        tagValue?: string(name='TagValue', description='The tag values of the resource.', example='value-1'),
      }
    ](name='Tags', description='The list of tags.'),
    templateContent?: string(name='TemplateContent', description='The information about the current compliance package template. The rules in the template do not contain custom function rules. You can quickly create the same compliance package for other accounts or account groups based on the template information.', example='{
    "configRuleTemplates": [
        {
            "configRuleName": "rule-example",
            "scope": {
                "complianceResourceTypes": [
                    "ACS::ECS::Instance"
                ]
            },
            "description": "",
            "source": {
                "owner": "CUSTOM_CONFIGURATION",
                "identifier": "acs-config-configuration",
                "sourceDetails": [
                    {
                        "messageType": "ScheduledNotification",
                        "maximumExecutionFrequency": "Twelve_Hours"
                    },
                    {
                        "messageType": "ConfigurationItemChangeNotification"
                    }
                ],
                "conditions": "{\\\\"ComplianceConditions\\\\":\\\\"{\\\\\\\\\\\\"operator\\\\\\\\\\\\":\\\\\\\\\\\\"and\\\\\\\\\\\\",\\\\\\\\\\\\"children\\\\\\\\\\\\":[{\\\\\\\\\\\\"operator\\\\\\\\\\\\":\\\\\\\\\\\\"GreaterOrEquals\\\\\\\\\\\\",\\\\\\\\\\\\"featurePath\\\\\\\\\\\\":\\\\\\\\\\\\"$.Cpu\\\\\\\\\\\\",\\\\\\\\\\\\"featureSource\\\\\\\\\\\\":\\\\\\\\\\\\"CONFIGURATION\\\\\\\\\\\\",\\\\\\\\\\\\"desired\\\\\\\\\\\\":\\\\\\\\\\\\"2\\\\\\\\\\\\"}]}\\\\"}"
            },
            "inputParameters": {}
        },
        {
            "configRuleName": "name",
            "scope": {
                "complianceResourceTypes": [
                    "ACS::OSS::Bucket"
                ]
            },
            "description": "description-1",
            "source": {
                "owner": "ALIYUN",
                "identifier": "oss-bucket-referer-limit",
                "sourceDetails": [
                    {
                        "messageType": "ConfigurationItemChangeNotification"
                    }
                ]
            },
            "inputParameters": {
                "allowEmptyReferer": "true",
                "allowReferers": "http://www.aliyun.com"
            }
        }
    ]
}'),
  }(name='CompliancePack', description='The details of the compliance package.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GetCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCompliancePackResponseBody(name='body'),
}

/**
 * @summary Queries the details of a compliance package.
 *
 * @description This topic provides an example on how to query the details of a compliance package whose ID is `cp-fdc8626622af00f9****`. The returned result shows that the name of the compliance package is `ClassifiedProtectionPreCheck`, the compliance package is in the `ACTIVE` state, and the risk level of the rules in the compliance package is `1`, which indicates high risk level.
 *
 * @param tmpReq GetCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCompliancePackResponse
 */
async function getCompliancePackWithOptions(tmpReq: GetCompliancePackRequest, runtime: Util.RuntimeOptions): GetCompliancePackResponse {
  Util.validateModel(tmpReq);
  var request = new GetCompliancePackShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a compliance package.
 *
 * @description This topic provides an example on how to query the details of a compliance package whose ID is `cp-fdc8626622af00f9****`. The returned result shows that the name of the compliance package is `ClassifiedProtectionPreCheck`, the compliance package is in the `ACTIVE` state, and the risk level of the rules in the compliance package is `1`, which indicates high risk level.
 *
 * @param request GetCompliancePackRequest
 * @return GetCompliancePackResponse
 */
async function getCompliancePack(request: GetCompliancePackRequest): GetCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCompliancePackWithOptions(request, runtime);
}

model GetCompliancePackReportRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-fdc8626622af00f9****'),
}

model GetCompliancePackReportResponseBody = {
  compliancePackReport?: {
    accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the compliance package belongs.', example='120886317861****'),
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-fdc8626622af00f9****'),
    reportCreateTimestamp?: long(name='ReportCreateTimestamp', description='The timestamp when the compliance evaluation report was generated. Unit: milliseconds.', example='1624329965857'),
    reportStatus?: string(name='ReportStatus', description='The status of the compliance evaluation report. Valid values:

*   NONE: The compliance evaluation report is not generated.
*   CREATING: The compliance evaluation report is being generated.
*   COMPLETE: The compliance evaluation report is generated.', example='COMPLETE'),
    reportUrl?: string(name='ReportUrl', description='The URL that is used to download the compliance evaluation report.'),
  }(name='CompliancePackReport', description='The information about the compliance evaluation report.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GetCompliancePackReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCompliancePackReportResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation report that is generated based on a compliance package.
 *
 * @description > Before you call this operation, you must call the GenerateCompliancePackReport operation to generate the latest compliance evaluation report based on a compliance package. For more information, see [GenerateCompliancePackReport](https://help.aliyun.com/document_detail/263525.html).
 * This topic provides an example on how to query the compliance evaluation report that is generated based on the `cp-fdc8626622af00f9****` compliance package.
 *
 * @param request GetCompliancePackReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCompliancePackReportResponse
 */
async function getCompliancePackReportWithOptions(request: GetCompliancePackReportRequest, runtime: Util.RuntimeOptions): GetCompliancePackReportResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCompliancePackReport',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation report that is generated based on a compliance package.
 *
 * @description > Before you call this operation, you must call the GenerateCompliancePackReport operation to generate the latest compliance evaluation report based on a compliance package. For more information, see [GenerateCompliancePackReport](https://help.aliyun.com/document_detail/263525.html).
 * This topic provides an example on how to query the compliance evaluation report that is generated based on the `cp-fdc8626622af00f9****` compliance package.
 *
 * @param request GetCompliancePackReportRequest
 * @return GetCompliancePackReportResponse
 */
async function getCompliancePackReport(request: GetCompliancePackReportRequest): GetCompliancePackReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCompliancePackReportWithOptions(request, runtime);
}

model GetComplianceSummaryResponseBody = {
  complianceSummary?: {
    complianceSummaryByConfigRule?: {
      complianceSummaryTimestamp?: long(name='ComplianceSummaryTimestamp', description='The time when the compliance summary was generated. Unit: milliseconds.', example='1589853712165'),
      compliantCount?: int32(name='CompliantCount', description='The number of rules evaluated as compliant.', example='5'),
      nonCompliantCount?: int32(name='NonCompliantCount', description='The number of rules evaluated as non-compliant.', example='11'),
      totalCount?: long(name='TotalCount', description='The total number of rules.', example='16'),
    }(name='ComplianceSummaryByConfigRule', description='The summary of compliance statistics from the rule dimension.'),
    complianceSummaryByResource?: {
      complianceSummaryTimestamp?: long(name='ComplianceSummaryTimestamp', description='The time when the compliance summary was generated. Unit: milliseconds.', example='1589853712165'),
      compliantCount?: int32(name='CompliantCount', description='The number of resources evaluated as compliant.', example='1'),
      nonCompliantCount?: int32(name='NonCompliantCount', description='The number of resources evaluated as non-compliant.', example='12'),
      totalCount?: long(name='TotalCount', description='The total number of resources.', example='13'),
    }(name='ComplianceSummaryByResource', description='The summary of compliance statistics from the resource dimension.'),
  }(name='ComplianceSummary', description='The summary of compliance statistics.'),
  requestId?: string(name='RequestId', description='The request ID.', example='CAEE6F34-DEDC-4BAA-AA8C-946D5D008737'),
}

model GetComplianceSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetComplianceSummaryResponseBody(name='body'),
}

/**
 * @summary Queries the summary of compliance statistics within the current account.
 *
 * @description This topic provides an example on how to query the compliance statistics of resources and rules in the current account group.
 *
 * @param request GetComplianceSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetComplianceSummaryResponse
 */
async function getComplianceSummaryWithOptions(runtime: Util.RuntimeOptions): GetComplianceSummaryResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetComplianceSummary',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the summary of compliance statistics within the current account.
 *
 * @description This topic provides an example on how to query the compliance statistics of resources and rules in the current account group.
 *
 * @return GetComplianceSummaryResponse
 */
async function getComplianceSummary(): GetComplianceSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getComplianceSummaryWithOptions(runtime);
}

model GetConfigDeliveryChannelRequest {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.

For more information about how to obtain the ID of a delivery channel, see [DescribeDeliveryChannels](https://help.aliyun.com/document_detail/429841.html).

This parameter is required.', example='cdc-d9106457e0d900b1****'),
}

model GetConfigDeliveryChannelResponseBody = {
  deliveryChannel?: {
    accountId?: long(name='AccountId', description='The ID of your Alibaba Cloud account.', example='120886317861****'),
    compliantSnapshot?: boolean(name='CompliantSnapshot', description='Indicates whether the specified destination receives scheduled compliant snapshots. Cloud Config delivers scheduled compliant snapshots at `04:00Z` and `16:00Z` to Log Service every day. The time is displayed in UTC. Valid values:

*   true: The specified destination receives scheduled compliant snapshots.
*   false: The specified destination does not receive scheduled compliant snapshots.', example='false'),
    configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Indicates whether the specified destination receives resource change logs. If the value of this parameter is true, Cloud Config delivers the resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true: The specified destination receives resource change logs.
*   false: The specified destination does not receive resource change logs.', example='true'),
    configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Indicates whether the specified destination receives scheduled resource snapshots. Cloud Config delivers scheduled resource snapshots at `04:00Z` and `16:00Z` to OSS, MNS, or Log Service every day. The time is displayed in UTC. Valid values:

*   true: The specified destination receives scheduled resource snapshots.
*   false: The specified destination does not receive scheduled resource snapshots.', example='false'),
    deliveryChannelAssumeRoleArn?: string(name='DeliveryChannelAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) of the role assumed by the delivery channel.', example='acs:ram::120886317861****:role/aliyunserviceroleforconfig'),
    deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that is attached to the delivery channel. This parameter is available when you deliver data of all types to MNS or deliver snapshots to Log Service.

*   If the value of the DeliveryChannelType parameter is MNS, take note of the following settings of the lowest risk level and resource types of the events to which you subscribed:

    *   The setting of the lowest risk level for the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

        The `value` field indicates the lowest risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

    *   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

        The `values` field indicates the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`

*   If you set the DeliveryChannelType parameter to SLS, the setting of the resource types of the snapshots to which you want to deliver is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the snapshots to which you want to deliver. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
    deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-d9106457e0d900b1****'),
    deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.', example='myDeliveryChannel'),
    deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The Alibaba Cloud Resource Name (ARN) of the delivery destination.

*   If the value of the DeliveryChannelType parameter is OSS, the value of this parameter is the ARN of the destination OSS bucket.
*   If the value of the DeliveryChannelType parameter is MNS, the value of this parameter is the ARN of the destination MNS topic.
*   If the value of the DeliveryChannelType parameter is SLS, the value of this parameter is the ARN of the destination Log Service Logstore.', example='acs:oss:cn-shanghai:120886317861****:new-bucket'),
    deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery channel. Valid values:

*   OSS: Object Storage Service (OSS)
*   MNS: Message Service (MNS)
*   SLS: Log Service', example='OSS'),
    deliverySnapshotTime?: string(name='DeliverySnapshotTime', description='The time when Cloud Config delivers scheduled resources snapshots every day.

Format: `HH:mmZ`. This time is displayed in UTC.', example='09:10Z'),
    description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
    nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Indicates whether the specified destination receives resource non-compliance events. If the value of this parameter is true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are evaluated as non-compliant. Valid values:

*   true: The specified destination receives resource non-compliance events.
*   false: The specified destination does not receive resource non-compliance events.', example='false'),
    oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
    status?: int32(name='Status', description='The status of the delivery channel. Valid values:

*   0: The delivery channel is disabled.
*   1: The delivery channel is enabled.', example='1'),
  }(name='DeliveryChannel', description='The information about the delivery channel.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DC300244-FCE3-5061-8214-C27ECB668487'),
}

model GetConfigDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConfigDeliveryChannelResponseBody(name='body'),
}

/**
 * @summary Queries the information about a delivery channel.
 *
 * @param request GetConfigDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConfigDeliveryChannelResponse
 */
async function getConfigDeliveryChannelWithOptions(request: GetConfigDeliveryChannelRequest, runtime: Util.RuntimeOptions): GetConfigDeliveryChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deliveryChannelId)) {
    query['DeliveryChannelId'] = request.deliveryChannelId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConfigDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a delivery channel.
 *
 * @param request GetConfigDeliveryChannelRequest
 * @return GetConfigDeliveryChannelResponse
 */
async function getConfigDeliveryChannel(request: GetConfigDeliveryChannelRequest): GetConfigDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigDeliveryChannelWithOptions(request, runtime);
}

model GetConfigRuleRequest {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-7f7d626622af0041****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.

You can specify at most 20 tag keys.', example='key-1'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 256 characters in length and cannot contain `http://` or `https://`.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetConfigRuleShrinkRequest {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-7f7d626622af0041****'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model GetConfigRuleResponseBody = {
  configRule?: {
    accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the rule belongs.', example='120886317861****'),
    compliance?: {
      complianceType?: string(name='ComplianceType', description='The statistics on the compliance evaluation results by compliance type. Valid values:

*   COMPLIANT: The resource was evaluated as compliant.
*   NON_COMPLIANT: The resource was evaluated as incompliant.
*   NOT_APPLICABLE: The rule did not apply to your resource.
*   INSUFFICIENT_DATA: No resource data was available.', example='NON_COMPLIANT'),
      count?: int32(name='Count', description='The number of evaluated resources.', example='3'),
    }(name='Compliance', description='The details of compliance evaluation results.'),
    configRuleArn?: string(name='ConfigRuleArn', description='The ARN of the managed rule.', example='acs:config::100931896542****:rule/cr-7f7d626622af0041****'),
    configRuleEvaluationStatus?: {
      firstActivatedTimestamp?: long(name='FirstActivatedTimestamp', description='The timestamp generated when the rule was first triggered. Unit: millisecond.', example='1624932221993'),
      firstEvaluationStarted?: boolean(name='FirstEvaluationStarted', description='Indicates whether resource configurations were evaluated based on the rule. Valid values:

*   true: Resource configurations were evaluated based on the rule.
*   false: Resource configurations were not evaluated based on the rule.', example='true'),
      lastErrorCode?: string(name='LastErrorCode', description='The error code returned for the previous failed compliance evaluation.', example='TimeOut'),
      lastErrorMessage?: string(name='LastErrorMessage', description='The error message returned for the previous failed compliance evaluation.', example='Time out'),
      lastFailedEvaluationTimestamp?: long(name='LastFailedEvaluationTimestamp', description='The timestamp generated when the previous failed compliance evaluation of the rule ended. Unit: millisecond.', example='1614687022000'),
      lastFailedInvocationTimestamp?: long(name='LastFailedInvocationTimestamp', description='The timestamp generated when the previous failed compliance evaluation of the rule started. Unit: millisecond.', example='1614687022000'),
      lastSuccessfulEvaluationTimestamp?: long(name='LastSuccessfulEvaluationTimestamp', description='The timestamp generated when the previous successful compliance evaluation of the rule ended. Unit: millisecond.', example='1624932227486'),
      lastSuccessfulInvocationTimestamp?: long(name='LastSuccessfulInvocationTimestamp', description='The timestamp generated when the previous successful compliance evaluation of the rule started. Unit: millisecond.', example='1624932227476'),
    }(name='ConfigRuleEvaluationStatus', description='The information about compliance evaluations performed by the rule.'),
    configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-7f7d626622af0041****'),
    configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='ecs-disk-auto-snapshot-policy'),
    configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:

*   ACTIVE: The rule is enabled.
*   DELETING: The rule is being deleted.
*   EVALUATING: The rule is being used to evaluate resource configurations.
*   INACTIVE: The rule is disabled.', example='ACTIVE'),
    configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule was triggered by configuration changes.
*   ScheduledNotification: The rule was periodically triggered.', example='ConfigurationItemChangeNotification'),
    createBy?: {
      compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='cp-541e626622af008****'),
      compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='example-name'),
      creatorId?: string(name='CreatorId', description='The ID of the account that was used to create the rule.', example='100931896542****'),
      creatorName?: string(name='CreatorName', description='The name of the account that was used to create the rule.', example='Alice'),
    }(name='CreateBy', description='The information about the creation of the rule.'),
    createTimestamp?: long(name='CreateTimestamp', description='The timestamp generated when the rule was created. Unit: millisecond.', example='1604684022000'),
    description?: string(name='Description', description='The description of the managed rule.', example='example-description'),
    excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='ExcludeRegionIdsScope', example='cn-shanghai'),
    excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope', example='rg-aekzdibsjjc****'),
    excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource excluded from the compliance evaluations performed by the rule.', example='23642660635687****'),
    excludeTagsScope?: [ 
      {
        tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
        tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
      }
    ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
    extendContent?: string(name='ExtendContent', description='Optional field, only used in conjunction with the 24-hour cycle execution to set the trigger time.', example='{"fixedHour":"12"}'),
    inputParameters?: map[string]any(name='InputParameters', description='The input parameters of the rule.', example='{}'),
    managedRule?: {
      compulsoryInputParameterDetails?: map[string]any(name='CompulsoryInputParameterDetails', description='The settings of the required input parameters for the managed rule.', example='{}'),
      description?: string(name='Description', description='The description of the managed rule.', example='example-description'),
      identifier?: string(name='Identifier', description='The identifier of the managed rule.', example='ram-user-mfa-check'),
      labels?: [ string ](name='Labels', description='The rule tags.'),
      managedRuleName?: string(name='ManagedRuleName', description='The name of the managed rule.', example='example-name'),
      optionalInputParameterDetails?: map[string]any(name='OptionalInputParameterDetails', description='The settings of the optional input parameters for the managed rule.', example='{}'),
      sourceDetails?: [ 
        {
          eventSource?: string(name='EventSource', description='The event source.

>  Only aliyun.config is returned, which indicates that only events related to Cloud Config are supported.', example='aliyun.config'),
          maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours

>  This parameter is returned if the rule is periodically triggered.', example='One_Hour'),
          messageType?: string(name='MessageType', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.', example='ConfigurationItemChangeNotification'),
        }
      ](name='SourceDetails', description='The details of the source of the managed rule.'),
    }(name='ManagedRule', description='The details of the managed rule.'),
    maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours

>  This parameter is returned if the rule is periodically triggered.', example='One_Hour'),
    modifiedTimestamp?: long(name='ModifiedTimestamp', description='The timestamp generated when the rule was last updated. Unit: millisecond.', example='1614687022000'),
    regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region to which the rule applies.', example='global'),
    resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group to which the rule applies.', example='rg-aekzdibsjjc****'),
    resourceIdsScope?: string(name='ResourceIdsScope', description='ResourceIdsScope', example='eip-8vbf3x310fn56ijfd****'),
    resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
    resourceTypesScope?: string(name='ResourceTypesScope', description='The type of the resource to be evaluated by the rule.', example='ACS::RAM::User'),
    riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high.
*   2: medium.
*   3: low.', example='1'),
    scope?: {
      complianceResourceTypes?: [ string ](name='ComplianceResourceTypes', description='The types of the resources to be evaluated against the rule. You can also view the resource types by using the ResourceTypesScope parameter.'),
    }(name='Scope', description='The effective scope of the rule.'),
    source?: {
      identifier?: string(name='Identifier', description='The identifier of the rule.

*   If the rule is a managed rule, the value of this parameter is the identifier of the managed rule.
*   If the rule is a custom rule, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of a function.', example='acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config'),
      owner?: string(name='Owner', description='The type of the rule. Valid values:

*   CUSTOM_FC: a custom rule.
*   ALIYUN: a managed rule.', example='ALIYUN'),
      sourceDetails?: [ 
        {
          eventSource?: string(name='EventSource', description='The event source.

>  Only aliyun.config is returned, which indicates that only events related to Cloud Config are supported.', example='aliyun.config'),
          maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours

>  This parameter is returned if the rule is periodically triggered.', example='One_Hour'),
          messageType?: string(name='MessageType', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.', example='ConfigurationItemChangeNotification'),
        }
      ](name='SourceDetails', description='The details of the source of the rule.'),
    }(name='Source', description='The information about how the rule was created.'),
    tagKeyLogicScope?: string(name='TagKeyLogicScope', description='When retrieving details of rules created using the parameter `TagsScope`, this field will not be returned.

To retrieve rules created using the deprecated field `TagKeyScope` (not recommended): for example, when the parameter `TagKeyScope` has a value of ECS,OSS, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels ECS and OSS.

Values:

 - AND: And.

 - OR: Or.', example='120886317861****'),
    tagKeyScope?: string(name='TagKeyScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag key used to filter resources. The rule applies only to the resources with the specified tag key.

>  The TagKeyScope and `TagValueScope` parameters are returned at the same time.``', example='RAM', deprecated=true),
    tagValueScope?: string(name='TagValueScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  The TagKeyScope and `TagValueScope` parameters are returned at the same time.``', example='MFA', deprecated=true),
    tags?: [ 
      {
        tagKey?: string(name='TagKey', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='key-1'),
        tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
      }
    ](name='Tags', description='The tag list.'),
    tagsScope?: [ 
      {
        tagKey?: string(name='TagKey', description='TagKey', example='key-1'),
        tagValue?: string(name='TagValue', description='TagValue', example='value-1'),
      }
    ](name='TagsScope', description='TagsScope'),
  }(name='ConfigRule', description='The details of the rule.'),
  requestId?: string(name='RequestId', description='The request ID.', example='811234F4-C3AB-4D15-B90B-F55016D1B5AA'),
}

model GetConfigRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConfigRuleResponseBody(name='body'),
}

/**
 * @summary Queries the details of a rule.
 *
 * @description This topic provides an example on how to query the details of the `cr-7f7d626622af0041****` rule.
 *
 * @param tmpReq GetConfigRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConfigRuleResponse
 */
async function getConfigRuleWithOptions(tmpReq: GetConfigRuleRequest, runtime: Util.RuntimeOptions): GetConfigRuleResponse {
  Util.validateModel(tmpReq);
  var request = new GetConfigRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConfigRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a rule.
 *
 * @description This topic provides an example on how to query the details of the `cr-7f7d626622af0041****` rule.
 *
 * @param request GetConfigRuleRequest
 * @return GetConfigRuleResponse
 */
async function getConfigRule(request: GetConfigRuleRequest): GetConfigRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigRuleWithOptions(request, runtime);
}

model GetConfigRuleComplianceByPackRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-541e626622af0087****'),
}

model GetConfigRuleComplianceByPackResponseBody = {
  configRuleComplianceResult?: {
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-541e626622af0087****'),
    configRuleCompliances?: [ 
      {
        complianceType?: string(name='ComplianceType', description='The compliance evaluation result. Valid values:

*   COMPLIANT: The relevant resources are evaluated as compliant.
*   NON_COMPLIANT: The relevant resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to your resources.
*   INSUFFICIENT_DATA: No resource data is available.', example='COMPLIANT'),
        configRuleId?: string(name='ConfigRuleId', description='The ID of the rule enabled in the compliance package.', example='cr-fdc8626622af00f9****'),
        configRuleName?: string(name='ConfigRuleName', description='The name of the rule enabled in the compliance package.', example='test-rule-name'),
      }
    ](name='ConfigRuleCompliances', description='The rule enabled in the compliance package and the compliance evaluation result returned by the rule.'),
    nonCompliantCount?: int32(name='NonCompliantCount', description='The number of rules against which specific resources are evaluated as non-compliant.', example='0'),
    totalCount?: int32(name='TotalCount', description='The total number of rules enabled in the compliance package.', example='1'),
  }(name='ConfigRuleComplianceResult', description='The information about the compliance evaluation results returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GetConfigRuleComplianceByPackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConfigRuleComplianceByPackResponseBody(name='body'),
}

/**
 * @summary Queries compliance evaluation results based on the rules in a compliance package.
 *
 * @description In this topic, the `cp-541e626622af0087****` compliance package is used as an example. The return result shows a total of one rule against which specific resources are evaluated as compliant.
 *
 * @param request GetConfigRuleComplianceByPackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConfigRuleComplianceByPackResponse
 */
async function getConfigRuleComplianceByPackWithOptions(request: GetConfigRuleComplianceByPackRequest, runtime: Util.RuntimeOptions): GetConfigRuleComplianceByPackResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConfigRuleComplianceByPack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries compliance evaluation results based on the rules in a compliance package.
 *
 * @description In this topic, the `cp-541e626622af0087****` compliance package is used as an example. The return result shows a total of one rule against which specific resources are evaluated as compliant.
 *
 * @param request GetConfigRuleComplianceByPackRequest
 * @return GetConfigRuleComplianceByPackResponse
 */
async function getConfigRuleComplianceByPack(request: GetConfigRuleComplianceByPackRequest): GetConfigRuleComplianceByPackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigRuleComplianceByPackWithOptions(request, runtime);
}

model GetConfigRuleSummaryByRiskLevelResponseBody = {
  configRuleSummaries?: [ 
    {
      compliantCount?: int32(name='CompliantCount', description='The number of rules against which specific resources are evaluated as compliant.', example='3'),
      nonCompliantCount?: int32(name='NonCompliantCount', description='The number of rules against which specific resources are evaluated as non-compliant.', example='1'),
      riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules. Valid values:

*   1: high risk level.
*   2: medium risk level.
*   3: low risk level.', example='1'),
    }
  ](name='ConfigRuleSummaries', description='The summary of compliance evaluation results by rule risk level.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A3CED98C-DE65-46AC-B2D2-04A4A9AB5B36'),
}

model GetConfigRuleSummaryByRiskLevelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConfigRuleSummaryByRiskLevelResponseBody(name='body'),
}

/**
 * @summary Queries the compliance summary based on the risk level of a rule.
 *
 * @description This topic provides an example of how to query the summary of compliance evaluation results by rule risk level. The return result shows four rules that are specified with the high risk level. One of them detects non-compliant resources, and the resources evaluated by the remaining three are all compliant.
 *
 * @param request GetConfigRuleSummaryByRiskLevelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConfigRuleSummaryByRiskLevelResponse
 */
async function getConfigRuleSummaryByRiskLevelWithOptions(runtime: Util.RuntimeOptions): GetConfigRuleSummaryByRiskLevelResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetConfigRuleSummaryByRiskLevel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance summary based on the risk level of a rule.
 *
 * @description This topic provides an example of how to query the summary of compliance evaluation results by rule risk level. The return result shows four rules that are specified with the high risk level. One of them detects non-compliant resources, and the resources evaluated by the remaining three are all compliant.
 *
 * @return GetConfigRuleSummaryByRiskLevelResponse
 */
async function getConfigRuleSummaryByRiskLevel(): GetConfigRuleSummaryByRiskLevelResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigRuleSummaryByRiskLevelWithOptions(runtime);
}

model GetConfigRulesReportRequest {
  reportId?: string(name='ReportId', description='The ID of the compliance evaluation report.', example='crp-88176457e0d900c9****'),
}

model GetConfigRulesReportResponseBody = {
  configRulesReport?: {
    accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the rules belong.', example='100931896542****'),
    reportCreateTimestamp?: long(name='ReportCreateTimestamp', description='The timestamp when the compliance evaluation report was generated. Unit: milliseconds.', example='1614687022000'),
    reportId?: string(name='ReportId', description='The ID of the compliance evaluation report.', example='crp-88176457e0d900c9****'),
    reportStatus?: string(name='ReportStatus', description='The status of the compliance evaluation report. Valid values:

*   NONE: The compliance evaluation report is not generated.
*   CREATING: The compliance evaluation report is being generated.
*   COMPLETE: The compliance evaluation report is generated.', example='CREATING'),
    reportUrl?: string(name='ReportUrl', description='The URL that is used to download the compliance evaluation report.'),
  }(name='ConfigRulesReport', description='The information about the compliance evaluation report.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model GetConfigRulesReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConfigRulesReportResponseBody(name='body'),
}

/**
 * @summary Downloads the compliance evaluation report in the Excel format to your on-premises machine. This allows you to assign tasks and modify incompliant resource configurations.
 *
 * @description >  Before you call this operation, you must call the GenerateConfigRulesReport operation to generate the latest compliance evaluation report based on all existing rules. For more information, see [GenerateConfigRulesReport](https://help.aliyun.com/document_detail/263601.html).
 * This topic provides an example of how to query the compliance evaluation report that is generated based on all existing rules.
 *
 * @param request GetConfigRulesReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConfigRulesReportResponse
 */
async function getConfigRulesReportWithOptions(request: GetConfigRulesReportRequest, runtime: Util.RuntimeOptions): GetConfigRulesReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConfigRulesReport',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Downloads the compliance evaluation report in the Excel format to your on-premises machine. This allows you to assign tasks and modify incompliant resource configurations.
 *
 * @description >  Before you call this operation, you must call the GenerateConfigRulesReport operation to generate the latest compliance evaluation report based on all existing rules. For more information, see [GenerateConfigRulesReport](https://help.aliyun.com/document_detail/263601.html).
 * This topic provides an example of how to query the compliance evaluation report that is generated based on all existing rules.
 *
 * @param request GetConfigRulesReportRequest
 * @return GetConfigRulesReportResponse
 */
async function getConfigRulesReport(request: GetConfigRulesReportRequest): GetConfigRulesReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigRulesReportWithOptions(request, runtime);
}

model GetConfigurationRecorderResponseBody = {
  configurationRecorder?: {
    configurationRecorderStatus?: string(name='ConfigurationRecorderStatus', description='The status of the configuration recorder. Valid values:

*   REGISTRABLE: The configuration recorder has not been registered.
*   BUILDING: The configuration recorder is being deployed.
*   REGISTERED: The configuration recorder has been registered.
*   REBUILDING: The configuration recorder is being redeployed.', example='REGISTERED'),
    resourceTypes?: [ string ](name='ResourceTypes', description='The types of resources that are monitored.'),
  }(name='ConfigurationRecorder', description='The details of the configuration recorder that monitors resources.'),
  requestId?: string(name='RequestId', description='The request ID.', example='AE43696A-B3AF-5E55-9845-11393127E6D3'),
}

model GetConfigurationRecorderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConfigurationRecorderResponseBody(name='body'),
}

/**
 * @summary Queries the activation status and resource monitoring scope of Cloud Config for the current account.
 *
 * @description This topic provides an example on how to query the activation status and resource monitoring scope of Cloud Config for the current account.
 *
 * @param request GetConfigurationRecorderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConfigurationRecorderResponse
 */
async function getConfigurationRecorderWithOptions(runtime: Util.RuntimeOptions): GetConfigurationRecorderResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetConfigurationRecorder',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the activation status and resource monitoring scope of Cloud Config for the current account.
 *
 * @description This topic provides an example on how to query the activation status and resource monitoring scope of Cloud Config for the current account.
 *
 * @return GetConfigurationRecorderResponse
 */
async function getConfigurationRecorder(): GetConfigurationRecorderResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigurationRecorderWithOptions(runtime);
}

model GetDiscoveredResourceRequest {
  complianceOption?: int32(name='ComplianceOption', description='Specifies whether to query the compliance results of the resource. Valid values:

*   0 (default): does not query the compliance results of the resource.
*   1: queries the compliance results of the resource.', example='0'),
  region?: string(name='Region', description='The ID of the region in which the resource resides.

For more information about how to query the region ID of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/411702.html).', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The resource ID.

For more information about how to obtain the ID of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/411702.html).

This parameter is required.', example='new-bucket'),
  resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to obtain the type of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/411702.html).

This parameter is required.', example='ACS::OSS::Bucket'),
}

model GetDiscoveredResourceResponseBody = {
  discoveredResourceDetail?: {
    accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
    availabilityZone?: string(name='AvailabilityZone', description='The ID of the zone in which the resource resides.', example='cn-hangzhou-h'),
    complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No data is available.', example='COMPLIANT'),
    configuration?: string(name='Configuration', description='The configuration of the resource.', example='{\\\\"AccessControlList\\\\":{\\\\"Grant\\\\":\\\\"private\\\\"},\\\\"ServerSideEncryptionRule\\\\":{\\\\"SSEAlgorithm\\\\":\\\\"None\\\\"},\\\\"Comment\\\\":\\\\"\\\\",\\\\"CreationDate\\\\":\\\\"2021-06-29T10:05:12.000Z\\\\",\\\\"Owner\\\\":{\\\\"DisplayName\\\\":\\\\"100931896542****\\\\",\\\\"ID\\\\":\\\\"100931896542****\\\\"},\\\\"StorageClass\\\\":\\\\"Standard\\\\",\\\\"DataRedundancyType\\\\":\\\\"LRS\\\\",\\\\"AllowEmptyReferer\\\\":\\\\"true\\\\",\\\\"Name\\\\":\\\\"new-bucket\\\\",\\\\"BucketPolicy\\\\":{\\\\"LogPrefix\\\\":\\\\"\\\\",\\\\"LogBucket\\\\":\\\\"\\\\"},\\\\"ExtranetEndpoint\\\\":\\\\"oss-cn-hangzhou.aliyuncs.com\\\\",\\\\"IntranetEndpoint\\\\":\\\\"oss-cn-hangzhou-internal.aliyuncs.com\\\\",\\\\"Location\\\\":\\\\"oss-cn-hangzhou\\\\"}'),
    region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
    resourceCreationTime?: long(name='ResourceCreationTime', description='The timestamp when the resource was created.', example='1624961112000'),
    resourceDeleted?: int32(name='ResourceDeleted', description='Indicates whether the resource was deleted. Valid values:

*   1: The resource was not deleted.
*   0: The resource was deleted.', example='1'),
    resourceId?: string(name='ResourceId', description='The resource ID.', example='new-bucket'),
    resourceName?: string(name='ResourceName', description='The name of the resource.', example='new-bucket'),
    resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The value of this parameter varies based on the resource type and may be empty.

*   If the ResourceType parameter is set to ACS::ECS::Instance, the resource is an ECS instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
*   If the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that is not in a specific state. In this case, this parameter is left empty.', example='offline'),
    resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::OSS::BucketACS::CDN::Domain'),
    tags?: string(name='Tags', description='The tags of the resource.', example='{\\\\"\\\\"hc\\\\"\\\\":[\\\\"\\\\"value2\\\\"\\\\"]}'),
  }(name='DiscoveredResourceDetail', description='The details of the resource.'),
  requestId?: string(name='RequestId', description='The request ID.', example='E4D71ACE-6B0A-46E0-8352-56952378CC7F'),
}

model GetDiscoveredResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDiscoveredResourceResponseBody(name='body'),
}

/**
 * @summary Queries the details of a specific resource.
 *
 * @description This topic provides an example on how to query the details of the Elastic Compute Service (ECS) instance `i-bp12g4xbl4i0brkn****` that resides in the China (Hangzhou) region.
 *
 * @param request GetDiscoveredResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDiscoveredResourceResponse
 */
async function getDiscoveredResourceWithOptions(request: GetDiscoveredResourceRequest, runtime: Util.RuntimeOptions): GetDiscoveredResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.complianceOption)) {
    query['ComplianceOption'] = request.complianceOption;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDiscoveredResource',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a specific resource.
 *
 * @description This topic provides an example on how to query the details of the Elastic Compute Service (ECS) instance `i-bp12g4xbl4i0brkn****` that resides in the China (Hangzhou) region.
 *
 * @param request GetDiscoveredResourceRequest
 * @return GetDiscoveredResourceResponse
 */
async function getDiscoveredResource(request: GetDiscoveredResourceRequest): GetDiscoveredResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDiscoveredResourceWithOptions(request, runtime);
}

model GetDiscoveredResourceCountsGroupByRegionRequest {
  resourceType?: string(name='ResourceType', description='The resource type.

For more information about how to obtain the type of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).', example='ACS::ECS::Instance'),
}

model GetDiscoveredResourceCountsGroupByRegionResponseBody = {
  discoveredResourceCountsSummary?: [ 
    {
      groupName?: string(name='GroupName', description='The dimension by which statistics are collected.

>  In most cases, the `Region` parameter instead of the GroupName parameter is returned.', example='cn-hangzhou'),
      region?: string(name='Region', description='The ID of the region by which statistics are collected.', example='cn-hangzhou'),
      resourceCount?: long(name='ResourceCount', description='The total number of resources.', example='10'),
    }
  ](name='DiscoveredResourceCountsSummary', description='The statistics on the resources.'),
  requestId?: string(name='RequestId', description='The request ID.', example='399BD94C-D20C-4D27-88D4-89E8D75C0595'),
}

model GetDiscoveredResourceCountsGroupByRegionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDiscoveredResourceCountsGroupByRegionResponseBody(name='body'),
}

/**
 * @summary Queries the statistics on resources by region.
 *
 * @description This topic provides an example to demonstrate how to query the statistics on resources by region. The returned result shows that a total of 10 resources exist in the `cn-hangzhou` region.
 *
 * @param request GetDiscoveredResourceCountsGroupByRegionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDiscoveredResourceCountsGroupByRegionResponse
 */
async function getDiscoveredResourceCountsGroupByRegionWithOptions(request: GetDiscoveredResourceCountsGroupByRegionRequest, runtime: Util.RuntimeOptions): GetDiscoveredResourceCountsGroupByRegionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDiscoveredResourceCountsGroupByRegion',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics on resources by region.
 *
 * @description This topic provides an example to demonstrate how to query the statistics on resources by region. The returned result shows that a total of 10 resources exist in the `cn-hangzhou` region.
 *
 * @param request GetDiscoveredResourceCountsGroupByRegionRequest
 * @return GetDiscoveredResourceCountsGroupByRegionResponse
 */
async function getDiscoveredResourceCountsGroupByRegion(request: GetDiscoveredResourceCountsGroupByRegionRequest): GetDiscoveredResourceCountsGroupByRegionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDiscoveredResourceCountsGroupByRegionWithOptions(request, runtime);
}

model GetDiscoveredResourceCountsGroupByResourceTypeRequest {
  region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
}

model GetDiscoveredResourceCountsGroupByResourceTypeResponseBody = {
  discoveredResourceCountsSummary?: [ 
    {
      groupName?: string(name='GroupName', description='The resource type by which the statistics are collected.

> We recommend that you use the `ResourceType` parameter.', example='ACS::ECS::Instance'),
      resourceCount?: long(name='ResourceCount', description='The total number of resources.', example='10'),
      resourceType?: string(name='ResourceType', description='The resource type by which the statistics are collected.', example='ACS::ECS::Instance'),
    }
  ](name='DiscoveredResourceCountsSummary', description='The statistics on the resources.'),
  requestId?: string(name='RequestId', description='The request ID.', example='AC9BD94C-D20C-4D27-88D4-89E8D75C051B'),
}

model GetDiscoveredResourceCountsGroupByResourceTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDiscoveredResourceCountsGroupByResourceTypeResponseBody(name='body'),
}

/**
 * @summary Queries the statistics on resources by resource type.
 *
 * @description This topic describes how to query the statistics on resources by resource type. The returned result shows that a total of 10 resources of the `ACS::ECS::Instance` resource type exist.
 *
 * @param request GetDiscoveredResourceCountsGroupByResourceTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDiscoveredResourceCountsGroupByResourceTypeResponse
 */
async function getDiscoveredResourceCountsGroupByResourceTypeWithOptions(request: GetDiscoveredResourceCountsGroupByResourceTypeRequest, runtime: Util.RuntimeOptions): GetDiscoveredResourceCountsGroupByResourceTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDiscoveredResourceCountsGroupByResourceType',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics on resources by resource type.
 *
 * @description This topic describes how to query the statistics on resources by resource type. The returned result shows that a total of 10 resources of the `ACS::ECS::Instance` resource type exist.
 *
 * @param request GetDiscoveredResourceCountsGroupByResourceTypeRequest
 * @return GetDiscoveredResourceCountsGroupByResourceTypeResponse
 */
async function getDiscoveredResourceCountsGroupByResourceType(request: GetDiscoveredResourceCountsGroupByResourceTypeRequest): GetDiscoveredResourceCountsGroupByResourceTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDiscoveredResourceCountsGroupByResourceTypeWithOptions(request, runtime);
}

model GetIntegratedServiceStatusRequest {
  serviceCode?: string(name='ServiceCode', description='The identity of the cloud service that is integrated with Cloud Config. Valid values:

*   eventbridge: EventBridge
*   cms: CloudMonitor
*   bpstudio: Cloud Architect Design Tools (CADT)

This parameter is required.', example='cadt'),
}

model GetIntegratedServiceStatusResponseBody = {
  aggregatorDeliveryDataType?: string(name='AggregatorDeliveryDataType', description='The type of the event that is integrated across accounts. Valid values:

*   NonCompliantNotification: non-compliance event', example='NonCompliantNotification'),
  data?: boolean(name='Data', description='Indicates whether the product has been integrated. Valid values:

*   true
*   false', example='true'),
  integratedTypes?: string(name='IntegratedTypes', description='The types of the integrated events. Separate multiple event types with commas (,). Valid values:

*   ConfigurationItemChangeNotification: resource change event
*   NonCompliantNotification: non-compliance event', example='NonCompliantNotification'),
  requestId?: string(name='RequestId', description='The request ID.', example='2E396C84-8D50-5F95-97FA-C0367181BA8A'),
}

model GetIntegratedServiceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIntegratedServiceStatusResponseBody(name='body'),
}

/**
 * @summary Queries the integration status of a specific cloud service.
 *
 * @param request GetIntegratedServiceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIntegratedServiceStatusResponse
 */
async function getIntegratedServiceStatusWithOptions(request: GetIntegratedServiceStatusRequest, runtime: Util.RuntimeOptions): GetIntegratedServiceStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.serviceCode)) {
    body['ServiceCode'] = request.serviceCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIntegratedServiceStatus',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the integration status of a specific cloud service.
 *
 * @param request GetIntegratedServiceStatusRequest
 * @return GetIntegratedServiceStatusResponse
 */
async function getIntegratedServiceStatus(request: GetIntegratedServiceStatusRequest): GetIntegratedServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIntegratedServiceStatusWithOptions(request, runtime);
}

model GetManagedRuleRequest {
  identifier?: string(name='Identifier', description='The identifier of the managed rule.

For more information about how to obtain the identifier of a managed rule, see [ListManagedRules](https://help.aliyun.com/document_detail/421144.html).

This parameter is required.', example='cdn-domain-https-enabled'),
}

model GetManagedRuleResponseBody = {
  managedRule?: {
    compulsoryInputParameterDetails?: map[string]any(name='CompulsoryInputParameterDetails', description='The details of the required input parameters for the managed rule.', example='{}'),
    configRuleName?: string(name='ConfigRuleName', description='The name of the managed rule.', example='cdn-domain-https-enabled'),
    description?: string(name='Description', description='The description of the managed rule.', example='If HTTPS encryption is enabled for the CDN domain name, the configuration is considered compliant.'),
    helpUrls?: string(name='HelpUrls', description='The URL of the topic that provides guidance on remediation for the managed rule.', example='https://example.aliyundoc.com'),
    identifier?: string(name='Identifier', description='The identifier of the managed rule.', example='cdn-domain-https-enabled'),
    labels?: [ string ](name='Labels', description='The tags of the managed rule.'),
    optionalInputParameterDetails?: map[string]any(name='OptionalInputParameterDetails', description='The details of the optional input parameters for the managed rule.', example='{}'),
    riskLevel?: int32(name='RiskLevel', description='The risk level of the managed rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
    scope?: {
      complianceResourceTypes?: [ string ](name='ComplianceResourceTypes', description='The types of resources to which the managed rule applies.'),
    }(name='Scope', description='The effective scope of the managed rule.'),
    sourceDetails?: [ 
      {
        maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values: Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours', example='TwentyFour_Hours'),
        messageType?: string(name='MessageType', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.', example='ConfigurationItemChangeNotification'),
      }
    ](name='SourceDetails', description='The information about the trigger type of the managed rule.'),
  }(name='ManagedRule', description='The details of the managed rule.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7E6DDC09-87C1-5310-A924-3491EAAE6F90'),
}

model GetManagedRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetManagedRuleResponseBody(name='body'),
}

/**
 * @summary Queries the details of a specific managed rule.
 *
 * @description This topic provides an example on how to query the details of the managed rule `cdn-domain-https-enabled`.
 *
 * @param request GetManagedRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetManagedRuleResponse
 */
async function getManagedRuleWithOptions(request: GetManagedRuleRequest, runtime: Util.RuntimeOptions): GetManagedRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.identifier)) {
    query['Identifier'] = request.identifier;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetManagedRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a specific managed rule.
 *
 * @description This topic provides an example on how to query the details of the managed rule `cdn-domain-https-enabled`.
 *
 * @param request GetManagedRuleRequest
 * @return GetManagedRuleResponse
 */
async function getManagedRule(request: GetManagedRuleRequest): GetManagedRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getManagedRuleWithOptions(request, runtime);
}

model GetRemediationTemplateRequest {
  templateIdentifier?: string(name='TemplateIdentifier', description='The ID of the automatic remediation template.

For more information about how to obtain the ID of a remediation template, see [Compliance library](https://help.aliyun.com/document_detail/2337741.html).', example='ACS-ALB-BulkyEnableDeletionProtection', nullable=true),
}

model GetRemediationTemplateResponseBody = {
  remediationTemplates?: [ 
    {
      managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The ID of the supported rule template.

This parameter is required.', example='alb-delete-protection-enabled'),
      remediationType?: string(name='RemediationType', description='The type of the automatic remediation template. The value is set to OOS.', example='OOS'),
      templateDefinition?: string(name='TemplateDefinition', description='The parameters of the automatic remediation template.', example='{\\\\"Parameters\\\\":{\\\\"regionId\\\\":{\\\\"AssociationProperty\\\\":\\\\"RegionId\\\\",\\\\"CreateDated\\\\":\\\\"2023-09-08T16:36:15\\\\",\\\\"Default\\\\":\\\\"{regionId}\\\\",\\\\"Description\\\\":{\\\\"en\\\\":\\\\"regionId\\\\",\\\\"zh-cn\\\\":\\\\"regionId\\\\"},\\\\"Id\\\\":538,\\\\"MaxKeyLength\\\\":\\\\"125\\\\",\\\\"MaxValueLength\\\\":\\\\"255\\\\",\\\\"ModifiedDate\\\\":\\\\"2023-09-08T16:36:15\\\\",\\\\"Name\\\\":\\\\"regionId\\\\",\\\\"Optional\\\\":1,\\\\"TemplateIdentifier\\\\":\\\\"ACS-ALB-BulkyEnableDeletionProtection\\\\",\\\\"Type\\\\":\\\\"String\\\\",\\\\"Version\\\\":\\\\"LASTEST\\\\"},\\\\"loadBalancerIds\\\\":{\\\\"CreateDated\\\\":\\\\"2023-09-08T16:36:16\\\\",\\\\"Default\\\\":\\\\"[\\\\\\\\\\\\"{resourceId}\\\\\\\\\\\\"]\\\\",\\\\"Description\\\\":{\\\\"en\\\\":\\\\"loadBalancerIds\\\\",\\\\"zh-cn\\\\":\\\\"loadBalancerIds\\\\"},\\\\"Id\\\\":539,\\\\"MaxKeyLength\\\\":\\\\"125\\\\",\\\\"MaxValueLength\\\\":\\\\"255\\\\",\\\\"ModifiedDate\\\\":\\\\"2023-09-08T16:36:16\\\\",\\\\"Name\\\\":\\\\"loadBalancerIds\\\\",\\\\"Optional\\\\":1,\\\\"TemplateIdentifier\\\\":\\\\"ACS-ALB-BulkyEnableDeletionProtection\\\\",\\\\"Type\\\\":\\\\"ARRAY\\\\",\\\\"Version\\\\":\\\\"LASTEST\\\\"}}}'),
      templateDescription?: string(name='TemplateDescription', description='The description of the automatic remediation template.

This parameter is required.', example='调用接口EnableDeletionProtection，开启ALB实例删除保护，请您知晓风险谨慎操作。'),
      templateIdentifier?: string(name='TemplateIdentifier', description='The ID of the automatic remediation template.', example='ACS-ALB-BulkyEnableDeletionProtection'),
      templateName?: string(name='TemplateName', description='The name of the automatic remediation template.', example='开启ALB实例删除保护'),
    }
  ](name='RemediationTemplates', description='The information about the automatic remediation template.'),
  requestId?: string(name='RequestId', description='The request ID.', example='E232FC35-BD40-51E3-B2EB-09416A234939'),
}

model GetRemediationTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRemediationTemplateResponseBody(name='body'),
}

/**
 * @summary Queries the details of an automatic remediation template.
 *
 * @description This topic provides an example on how to query the details of the automatic remediation template ACS-ALB-BulkyEnableDeletionProtection.
 *
 * @param request GetRemediationTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRemediationTemplateResponse
 */
async function getRemediationTemplateWithOptions(request: GetRemediationTemplateRequest, runtime: Util.RuntimeOptions): GetRemediationTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.templateIdentifier)) {
    query['TemplateIdentifier'] = request.templateIdentifier;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRemediationTemplate',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an automatic remediation template.
 *
 * @description This topic provides an example on how to query the details of the automatic remediation template ACS-ALB-BulkyEnableDeletionProtection.
 *
 * @param request GetRemediationTemplateRequest
 * @return GetRemediationTemplateResponse
 */
async function getRemediationTemplate(request: GetRemediationTemplateRequest): GetRemediationTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRemediationTemplateWithOptions(request, runtime);
}

model GetResourceComplianceByConfigRuleRequest {
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No data is available.', example='COMPLIANT'),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

This parameter is required.', example='cr-d369626622af008e****'),
}

model GetResourceComplianceByConfigRuleResponseBody = {
  complianceResult?: {
    compliances?: [ 
      {
        complianceType?: string(name='ComplianceType', description='The compliance evaluation results of the resources. Valid values:

*   COMPLIANT: The resource was evaluated as compliant.
*   NON_COMPLIANT: The resource was evaluated as incompliant.
*   NOT_APPLICABLE: The rule did not apply to your resources.
*   INSUFFICIENT_DATA: No resource data was available.', example='COMPLIANT'),
        count?: int32(name='Count', description='The number of resources that have compliance evaluation results. For example, if the value of the `ComplianceType` parameter is `COMPLIANT`, this parameter value indicates the number of compliant resources.', example='5'),
      }
    ](name='Compliances', description='The compliance evaluation results based on compliance types.'),
    totalCount?: long(name='TotalCount', description='The total number of evaluated resources.', example='10'),
  }(name='ComplianceResult', description='The compliance result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='23306AB1-34E0-468F-BD7B-68D8AEAB753d'),
}

model GetResourceComplianceByConfigRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceComplianceByConfigRuleResponseBody(name='body'),
}

/**
 * @summary Queries the compliance summary based on the compliance evaluation result of a rule.
 *
 * @description In this topic, the `cr-d369626622af008e****` rule is used as an example. The return result shows that a total of 10 resources are evaluated by the rule and `five` of them are evaluated as compliant.
 *
 * @param request GetResourceComplianceByConfigRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceComplianceByConfigRuleResponse
 */
async function getResourceComplianceByConfigRuleWithOptions(request: GetResourceComplianceByConfigRuleRequest, runtime: Util.RuntimeOptions): GetResourceComplianceByConfigRuleResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceComplianceByConfigRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance summary based on the compliance evaluation result of a rule.
 *
 * @description In this topic, the `cr-d369626622af008e****` rule is used as an example. The return result shows that a total of 10 resources are evaluated by the rule and `five` of them are evaluated as compliant.
 *
 * @param request GetResourceComplianceByConfigRuleRequest
 * @return GetResourceComplianceByConfigRuleResponse
 */
async function getResourceComplianceByConfigRule(request: GetResourceComplianceByConfigRuleRequest): GetResourceComplianceByConfigRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceComplianceByConfigRuleWithOptions(request, runtime);
}

model GetResourceComplianceByPackRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-541e626622af0087****'),
}

model GetResourceComplianceByPackResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
  resourceComplianceResult?: {
    compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-541e626622af0087****'),
    nonCompliantCount?: int32(name='NonCompliantCount', description='The number of non-compliant resources.', example='7'),
    totalCount?: int32(name='TotalCount', description='The total number of resources.', example='10'),
  }(name='ResourceComplianceResult', description='The compliance evaluation results returned.'),
}

model GetResourceComplianceByPackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceComplianceByPackResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation results of resources evaluated based on a compliance package.
 *
 * @description This topic provides an example on how to query the compliance evaluation results of resources monitored by using the `cp-541e626622af0087****` compliance package. The returned result shows a total of 10 resources and seven of them are evaluated as non-compliant.
 *
 * @param request GetResourceComplianceByPackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceComplianceByPackResponse
 */
async function getResourceComplianceByPackWithOptions(request: GetResourceComplianceByPackRequest, runtime: Util.RuntimeOptions): GetResourceComplianceByPackResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceComplianceByPack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation results of resources evaluated based on a compliance package.
 *
 * @description This topic provides an example on how to query the compliance evaluation results of resources monitored by using the `cp-541e626622af0087****` compliance package. The returned result shows a total of 10 resources and seven of them are evaluated as non-compliant.
 *
 * @param request GetResourceComplianceByPackRequest
 * @return GetResourceComplianceByPackResponse
 */
async function getResourceComplianceByPack(request: GetResourceComplianceByPackRequest): GetResourceComplianceByPackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceComplianceByPackWithOptions(request, runtime);
}

model GetResourceComplianceGroupByRegionRequest {
  configRuleIds?: string(name='ConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).', example='cr-2541626622af0000****'),
}

model GetResourceComplianceGroupByRegionResponseBody = {
  complianceResult?: {
    complianceResultList?: [ 
      {
        compliances?: [ 
          {
            complianceType?: string(name='ComplianceType', description='The evaluation result. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No resource data is available.', example='COMPLIANT'),
            count?: long(name='Count', description='The total number of evaluation results.', example='1'),
          }
        ](name='Compliances', description='The queried evaluation results.'),
        regionId?: string(name='RegionId', description='The region ID of the evaluated resource.', example='cn-beijing'),
      }
    ](name='ComplianceResultList', description='The evaluation results grouped by region.'),
  }(name='ComplianceResult', description='The queried evaluation results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0FDF8006-34A0-5334-8C79-48F64EAB34F1'),
}

model GetResourceComplianceGroupByRegionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceComplianceGroupByRegionResponseBody(name='body'),
}

/**
 * @summary Queries the evaluation results grouped by region for a rule.
 *
 * @param request GetResourceComplianceGroupByRegionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceComplianceGroupByRegionResponse
 */
async function getResourceComplianceGroupByRegionWithOptions(request: GetResourceComplianceGroupByRegionRequest, runtime: Util.RuntimeOptions): GetResourceComplianceGroupByRegionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceComplianceGroupByRegion',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the evaluation results grouped by region for a rule.
 *
 * @param request GetResourceComplianceGroupByRegionRequest
 * @return GetResourceComplianceGroupByRegionResponse
 */
async function getResourceComplianceGroupByRegion(request: GetResourceComplianceGroupByRegionRequest): GetResourceComplianceGroupByRegionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceComplianceGroupByRegionWithOptions(request, runtime);
}

model GetResourceComplianceGroupByResourceTypeRequest {
  configRuleIds?: string(name='ConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).', example='cr-a5c6626622af0058****'),
}

model GetResourceComplianceGroupByResourceTypeResponseBody = {
  complianceResult?: {
    complianceResultList?: [ 
      {
        compliances?: [ 
          {
            complianceType?: string(name='ComplianceType', description='The evaluation result. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resource.
*   INSUFFICIENT_DATA: No data is available.', example='COMPLIANT'),
            count?: long(name='Count', description='The total number of evaluation results.', example='1'),
          }
        ](name='Compliances', description='The queried evaluation results.'),
        resourceType?: string(name='ResourceType', description='The type of the evaluated resource.', example='ACS::ECS::Instance'),
      }
    ](name='ComplianceResultList', description='The evaluation results grouped by resource type.'),
  }(name='ComplianceResult', description='The queried evaluation results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='84610B68-2DD3-5AF0-B68D-E1FA8F051F7D'),
}

model GetResourceComplianceGroupByResourceTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceComplianceGroupByResourceTypeResponseBody(name='body'),
}

/**
 * @summary Queries the evaluation results grouped by resource type for a rule.
 *
 * @param request GetResourceComplianceGroupByResourceTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceComplianceGroupByResourceTypeResponse
 */
async function getResourceComplianceGroupByResourceTypeWithOptions(request: GetResourceComplianceGroupByResourceTypeRequest, runtime: Util.RuntimeOptions): GetResourceComplianceGroupByResourceTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceComplianceGroupByResourceType',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the evaluation results grouped by resource type for a rule.
 *
 * @param request GetResourceComplianceGroupByResourceTypeRequest
 * @return GetResourceComplianceGroupByResourceTypeResponse
 */
async function getResourceComplianceGroupByResourceType(request: GetResourceComplianceGroupByResourceTypeRequest): GetResourceComplianceGroupByResourceTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceComplianceGroupByResourceTypeWithOptions(request, runtime);
}

model GetResourceComplianceTimelineRequest {
  endTime?: long(name='EndTime', description='The timestamp that specifies the end of the time range to query. The default value is the time when the GetResourceComplianceTimeline operation is called. Unit: milliseconds.', example='1625821156000'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 1 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is used to initiate the next request. If the response of the current request is truncated, this token is used to initiate another request and obtain the remaining entries.', example='IWBjqMYSy0is7zSMGu16****'),
  region?: string(name='Region', description='The ID of the region where the resource resides.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The ID of the resource.

For more information about how to obtain the ID of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='new-bucket'),
  resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to obtain the type of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='ACS::OSS::Bucket'),
  startTime?: long(name='StartTime', description='The timestamp that specifies the beginning of the time range to query. By default, Cloud Config retrieves the compliance evaluations in the last 30 days for the specified resource. Unit: milliseconds.', example='1623211156000'),
}

model GetResourceComplianceTimelineResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8D53A78F-1EB8-4264-A554-72F07E34FAE6'),
  resourceComplianceTimeline?: {
    complianceList?: [ 
      {
        accountId?: string(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
        availabilityZone?: string(name='AvailabilityZone', description='The ID of the zone in which the resource resides.', example='cn-hangzhou-f'),
        captureTime?: long(name='CaptureTime', description='The timestamp when the compliance evaluation was recorded. Unit: milliseconds.', example='1625200295276'),
        configuration?: string(name='Configuration', description='The rules associated with the resource and the compliance details of the rules.', example='{\\\\"Compliance\\\\":{\\\\"complianceType\\\\":\\\\"COMPLIANT\\\\",\\\\"count\\\\":1},\\\\"ConfigRuleList\\\\":[{\\\\"accountId\\\\":100931896542****,\\\\"configRuleId\\\\":\\\\"cr-9524626622af003d****\\\\",\\\\"configRuleArn\\\\":\\\\"acs:config::100931896542****:rule/cr-9524626622af003d****\\\\",\\\\"configRuleName\\\\":\\\\"test-rule-name\\\\",\\\\"complianceType\\\\":\\\\"COMPLIANT\\\\",\\\\"riskLevel\\\\":1,\\\\"annotation\\\\":\\\\"\\\\",\\\\"invokingEventMessageType\\\\":\\\\"ScheduledNotification\\\\"}]}'),
        configurationDiff?: string(name='ConfigurationDiff', description='The details of the resource changes that trigger the compliance evaluation.', example='{\\\\"test-rule-name\\\\":[{\\\\"accountId\\\\":100931896542****,\\\\"configRuleId\\\\":\\\\"cr-965f626622af003d****\\\\",\\\\"configRuleArn\\\\":\\\\"acs:config::100931896542****:rule/cr-965f626622af003d****\\\\",\\\\"configRuleName\\\\":\\\\"test-rule-name\\\\",\\\\"complianceType\\\\":\\\\"COMPLIANT\\\\",\\\\"riskLevel\\\\":1,\\\\"annotation\\\\":\\\\"\\\\",\\\\"invokingEventMessageType\\\\":\\\\"ScheduledNotification\\\\"},{}]}'),
        region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
        resourceCreateTime?: long(name='ResourceCreateTime', description='The time when the resource was created. Unit: milliseconds.', example='1624961112000'),
        resourceId?: string(name='ResourceId', description='The resource ID.', example='new-bucket'),
        resourceName?: string(name='ResourceName', description='The resource name.', example='new-bucket'),
        resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The parameter value varies based on the resource type and may be left empty. Examples:

*   If the ResourceType parameter is set to ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
*   If the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that is not in a specific state. In this case, this parameter is left empty.', example='Running'),
        resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::OSS::Bucket'),
        tags?: string(name='Tags', description='The tags of the resource.', example='{\\\\"\\\\"hc\\\\"\\\\":[\\\\"\\\\"value2\\\\"\\\\"]}'),
      }
    ](name='ComplianceList', description='The compliance evaluation records on the compliance timeline.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries that can be returned for a single request.', example='10'),
    nextToken?: string(name='NextToken', description='The token that is used to initiate the next request.', example='5OVS5J4I1/UKTkHV5oNs****'),
  }(name='ResourceComplianceTimeline', description='The information about the compliance timeline.'),
}

model GetResourceComplianceTimelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceComplianceTimelineResponseBody(name='body'),
}

/**
 * @summary Queries the compliance timeline of a resource. The compliance timeline of a resource indicates the compliance evaluation record of the resource. A compliance timeline includes points and the content on the compliance timeline.
 *
 * @description In Cloud Config, each resource has a compliance timeline. Cloud Config generates a compliance evaluation record for a resource each time the resource is evaluated based on a rule. The compliance evaluation records of a resource are displayed in a compliance timeline. You can configure Cloud Config to execute a rule to evaluate a resource on a regular basis or each time you change the resource configuration. You can also manually execute a rule to evaluate a resource.
 * This topic provides an example on how to query the compliance timeline of the `new-bucket` resource that resides in the `cn-hangzhou` region. The resource is an Object Storage Service (OSS) bucket. The returned result shows the following two timestamps on the compliance timeline: `1625200295276` and `1625200228510`. The first timestamp indicates 12:31:35 on July 2, 2021 (UTC+8) and the second timestamp indicates 12:30:28 on July 2, 2021 (UTC+8).
 *
 * @param request GetResourceComplianceTimelineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceComplianceTimelineResponse
 */
async function getResourceComplianceTimelineWithOptions(request: GetResourceComplianceTimelineRequest, runtime: Util.RuntimeOptions): GetResourceComplianceTimelineResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceComplianceTimeline',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance timeline of a resource. The compliance timeline of a resource indicates the compliance evaluation record of the resource. A compliance timeline includes points and the content on the compliance timeline.
 *
 * @description In Cloud Config, each resource has a compliance timeline. Cloud Config generates a compliance evaluation record for a resource each time the resource is evaluated based on a rule. The compliance evaluation records of a resource are displayed in a compliance timeline. You can configure Cloud Config to execute a rule to evaluate a resource on a regular basis or each time you change the resource configuration. You can also manually execute a rule to evaluate a resource.
 * This topic provides an example on how to query the compliance timeline of the `new-bucket` resource that resides in the `cn-hangzhou` region. The resource is an Object Storage Service (OSS) bucket. The returned result shows the following two timestamps on the compliance timeline: `1625200295276` and `1625200228510`. The first timestamp indicates 12:31:35 on July 2, 2021 (UTC+8) and the second timestamp indicates 12:30:28 on July 2, 2021 (UTC+8).
 *
 * @param request GetResourceComplianceTimelineRequest
 * @return GetResourceComplianceTimelineResponse
 */
async function getResourceComplianceTimeline(request: GetResourceComplianceTimelineRequest): GetResourceComplianceTimelineResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceComplianceTimelineWithOptions(request, runtime);
}

model GetResourceConfigurationTimelineRequest {
  endTime?: long(name='EndTime', description='The end of the time range to query. The default value indicates the time when the GetResourceConfigurationTimeline operation is called. Unit: milliseconds.', example='1625821156000'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 1 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of `NextToken`.', example='IWBjqMYSy0is7zSMGu16****'),
  region?: string(name='Region', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The resource IDs.

For more information about how to query the ID of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='new-bucket'),
  resourceType?: string(name='ResourceType', description='The resource type.

For more information about how to obtain the type of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='ACS::OSS::Bucket'),
  startTime?: long(name='StartTime', description='The beginning of the time range to query. By default, Cloud Config retrieves the configuration changes in the last 30 days for the specified resource. Unit: milliseconds.', example='1623211156000'),
}

model GetResourceConfigurationTimelineResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='ED9CD1B3-286C-4E05-A765-5E1E0B9BC2AB'),
  resourceConfigurationTimeline?: {
    configurationList?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
        availabilityZone?: string(name='AvailabilityZone', description='The zone ID.', example='cn-hangzhou-h'),
        captureTime?: string(name='CaptureTime', description='The time when the resource change snapshot was recorded. Unit: milliseconds.', example='1624961156000'),
        configurationDiff?: string(name='ConfigurationDiff', description='The details of the resource changes that trigger the compliance evaluation.', example='{\\\\"AccessControlList\\\\":[null,{\\\\"Grant\\\\":\\\\"private\\\\"}],\\\\"ServerSideEncryptionRule\\\\":[null,{\\\\"SSEAlgorithm\\\\":\\\\"None\\\\"}],\\\\"CreationDate\\\\":[null,\\\\"2021-06-29T10:05:12.000Z\\\\"],\\\\"Owner\\\\":[null,{\\\\"DisplayName\\\\":\\\\"100931896542****\\\\",\\\\"ID\\\\":\\\\"100931896542****\\\\"}],\\\\"BucketPolicy\\\\":[null,{\\\\"LogPrefix\\\\":\\\\"\\\\",\\\\"LogBucket\\\\":\\\\"\\\\"}],\\\\"StorageClass\\\\":[null,\\\\"Standard\\\\"],\\\\"ExtranetEndpoint\\\\":[null,\\\\"oss-cn-hangzhou.aliyuncs.com\\\\"],\\\\"DataRedundancyType\\\\":[null,\\\\"LRS\\\\"],\\\\"AllowEmptyReferer\\\\":[null,\\\\"true\\\\"],\\\\"IntranetEndpoint\\\\":[null,\\\\"oss-cn-hangzhou-internal.aliyuncs.com\\\\"],\\\\"Name\\\\":[null,\\\\"new-bucket\\\\"],\\\\"Location\\\\":[null,\\\\"oss-cn-hangzhou\\\\"]}'),
        region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
        relationship?: string(name='Relationship', description='The details of each resource that is associated with the current resource, including the region ID, resource relationship, resource ID, and resource type.', example='""'),
        relationshipDiff?: string(name='RelationshipDiff', description='The change records of the resource relationship.', example='""'),
        resourceCreateTime?: string(name='ResourceCreateTime', description='The time when the resource was created. Unit: milliseconds.', example='1624961112000'),
        resourceEventType?: string(name='ResourceEventType', description='The type of the resource change event. Valid values:

*   DISCOVERED: A resource is created.
*   DISCOVERED_REVISED: A resource is created by periodic remediation tasks.
*   MODIFY: A resource is modified.
*   MODIFY_REVISED: A resource is modified by periodic remediation tasks.
*   REMOVE: A resource is deleted.

> 

*   To ensure the integrity of resources, periodic remediation tasks are run to check data and generate events that indicate the creation of new resources. Such events are infrequent.

*   The time when a resource change event is generated by a periodic remediation task is considered as the detection time of Cloud Config. The detection time is later than the time when the resource is modified.', example='DISCOVERED'),
        resourceId?: string(name='ResourceId', description='The resource ID.', example='new-bucket'),
        resourceName?: string(name='ResourceName', description='The resource name.', example='new-bucket'),
        resourceType?: string(name='ResourceType', description='The resource type.', example='ACS::OSS::Bucket'),
        tags?: string(name='Tags', description='The tags of the resource.', example='{\\\\"\\\\"hc\\\\"\\\\":[\\\\"\\\\"value2\\\\"\\\\"]}'),
      }
    ](name='ConfigurationList', description='The configuration changes on the configuration timeline.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned for a single request.', example='10'),
    nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='IWBjqMYSy0is7zSMGu16****'),
  }(name='ResourceConfigurationTimeline', description='The configuration timeline of the resource.'),
}

model GetResourceConfigurationTimelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceConfigurationTimelineResponseBody(name='body'),
}

/**
 * @summary Queries the configuration timeline of a resource.
 *
 * @description The sample request in this topic shows you how to query the configuration timeline of the `new-bucket` resource that resides in the `cn-hangzhou` region. The new-bucket resource is an Object Storage Service (OSS) bucket. The return result shows that the timestamp when the resource configuration changes is `1624961112000`. The timestamp indicates 18:05:12 on June 29, 2021 (UTC+8).
 *
 * @param request GetResourceConfigurationTimelineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceConfigurationTimelineResponse
 */
async function getResourceConfigurationTimelineWithOptions(request: GetResourceConfigurationTimelineRequest, runtime: Util.RuntimeOptions): GetResourceConfigurationTimelineResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceConfigurationTimeline',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configuration timeline of a resource.
 *
 * @description The sample request in this topic shows you how to query the configuration timeline of the `new-bucket` resource that resides in the `cn-hangzhou` region. The new-bucket resource is an Object Storage Service (OSS) bucket. The return result shows that the timestamp when the resource configuration changes is `1624961112000`. The timestamp indicates 18:05:12 on June 29, 2021 (UTC+8).
 *
 * @param request GetResourceConfigurationTimelineRequest
 * @return GetResourceConfigurationTimelineResponse
 */
async function getResourceConfigurationTimeline(request: GetResourceConfigurationTimelineRequest): GetResourceConfigurationTimelineResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceConfigurationTimelineWithOptions(request, runtime);
}

model GetResourceInventoryResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='89E2F38F-4EE4-545A-BD56-92E007ECFEE9'),
  resourceInventory?: {
    downloadUrl?: string(name='DownloadUrl', description='The download URL of the resource inventory.'),
    resourceInventoryGenerateTime?: long(name='ResourceInventoryGenerateTime', description='The time when the resource inventory was generated. The value is a timestamp.', example='1687674634220'),
    status?: string(name='Status', description='The generation status of the resource inventory. Valid values:

*   CREATING: The resource inventory is being generated.
*   COMPLETE: The resource inventory is generated.', example='COMPLETE'),
  }(name='ResourceInventory', description='The information about the resource inventory.'),
}

model GetResourceInventoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceInventoryResponseBody(name='body'),
}

/**
 * @summary Obtains the last resource inventory that is generated within the current Alibaba Cloud account.
 *
 * @description ### [](#)Prerequisites
 * You can call the [GenerateResourceInventory](https://help.aliyun.com/document_detail/2398354.html) operation to generate a resource inventory. Then, you can call the GetResourceInventory operation to obtain the URL of the resource inventory.
 * ### [](#)Description
 * This topic provides an example on how to obtain the last resource inventory that is generated within the current Alibaba Cloud account.
 *
 * @param request GetResourceInventoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceInventoryResponse
 */
async function getResourceInventoryWithOptions(runtime: Util.RuntimeOptions): GetResourceInventoryResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetResourceInventory',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the last resource inventory that is generated within the current Alibaba Cloud account.
 *
 * @description ### [](#)Prerequisites
 * You can call the [GenerateResourceInventory](https://help.aliyun.com/document_detail/2398354.html) operation to generate a resource inventory. Then, you can call the GetResourceInventory operation to obtain the URL of the resource inventory.
 * ### [](#)Description
 * This topic provides an example on how to obtain the last resource inventory that is generated within the current Alibaba Cloud account.
 *
 * @return GetResourceInventoryResponse
 */
async function getResourceInventory(): GetResourceInventoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceInventoryWithOptions(runtime);
}

model GetSupportedResourceRelationConfigRequest {
  resourceType?: string(name='ResourceType', description='The resource type.

This parameter is required.', example='ACS::ECS::Instance'),
}

model GetSupportedResourceRelationConfigResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='409D022F-394C-5AAB-A74A-2F1DC9F6375E'),
  resourceRelationConfigList?: [ 
    {
      relationType?: string(name='RelationType', description='The type of the relationship between the resource and the object. Valid values:

*   IsContained: The object is included as part of the resource.
*   IsAttachedTo: The object is added to the resource.
*   IsAssociatedIn: The object is associated with the resource.
*   Contains: The actual value contains the expected value.', example='IsAttachedTo'),
      targetResourceType?: string(name='TargetResourceType', description='The resource type.', example='ACS::ECS::Disk'),
    }
  ](name='ResourceRelationConfigList', description='An array that contains the relationships.'),
}

model GetSupportedResourceRelationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSupportedResourceRelationConfigResponseBody(name='body'),
}

/**
 * @summary Queries the resource relationships supported by a resource type.
 *
 * @description This topic provides an example to show how to query the resource relationships that are supported by the ACS::ECS::Instance resource type.
 *
 * @param request GetSupportedResourceRelationConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSupportedResourceRelationConfigResponse
 */
async function getSupportedResourceRelationConfigWithOptions(request: GetSupportedResourceRelationConfigRequest, runtime: Util.RuntimeOptions): GetSupportedResourceRelationConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSupportedResourceRelationConfig',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resource relationships supported by a resource type.
 *
 * @description This topic provides an example to show how to query the resource relationships that are supported by the ACS::ECS::Instance resource type.
 *
 * @param request GetSupportedResourceRelationConfigRequest
 * @return GetSupportedResourceRelationConfigResponse
 */
async function getSupportedResourceRelationConfig(request: GetSupportedResourceRelationConfigRequest): GetSupportedResourceRelationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSupportedResourceRelationConfigWithOptions(request, runtime);
}

model IgnoreAggregateEvaluationResultsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-5b6c626622af008f****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-7e72626622af0051****'),
  ignoreDate?: string(name='IgnoreDate', description='The date from which the system automatically re-evaluates the ignored incompliant resources.

>  If you leave this parameter empty, the system does not automatically re-evaluate the ignored incompliant resources. You must manually re-evaluate the ignored incompliant resources.', example='2022-06-01'),
  reason?: string(name='Reason', description='The reason why you ignore the resource.', example='The reason why you ignore the resource.'),
  resources?: [ 
    {
      region?: string(name='Region', description='The ID of the region in which the resource resides.

For more information about how to obtain the ID of a region, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='cn-beijing'),
      resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resources belong.

>  You must specify the ID of the current management account or a member account in the account group of the management account.

This parameter is required.', example='120886317861****'),
      resourceId?: string(name='ResourceId', description='The ID of the resource.

For more information about how to query the ID of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='lb-hp3a3b4ztyfm2plgm****'),
      resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to query the type of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='ACS::SLB::LoadBalancer'),
    }
  ](name='Resources', description='The resources to be ignored.

This parameter is required.'),
}

model IgnoreAggregateEvaluationResultsShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-5b6c626622af008f****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-7e72626622af0051****'),
  ignoreDate?: string(name='IgnoreDate', description='The date from which the system automatically re-evaluates the ignored incompliant resources.

>  If you leave this parameter empty, the system does not automatically re-evaluate the ignored incompliant resources. You must manually re-evaluate the ignored incompliant resources.', example='2022-06-01'),
  reason?: string(name='Reason', description='The reason why you ignore the resource.', example='The reason why you ignore the resource.'),
  resourcesShrink?: string(name='Resources', description='The resources to be ignored.

This parameter is required.'),
}

model IgnoreAggregateEvaluationResultsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0132CBF2-0B0B-59F2-9E84-07B38267BC32'),
}

model IgnoreAggregateEvaluationResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: IgnoreAggregateEvaluationResultsResponseBody(name='body'),
}

/**
 * @summary Ignores the evaluation results of some resources in an account group based on a specific rule. You can also specify a time period for ignoring the evaluation results. After the period elapses, the evaluation results of the resources based on the rule are automatically displayed.
 *
 * @description After you ignore a resource that is evaluated as incompliant by using a rule, the resource is still evaluated by using the rule, but the compliance result is Ignored.
 * This example shows how to ignore the `lb-hp3a3b4ztyfm2plgm****` incompliant resource that is evaluated by using the `cr-7e72626622af0051***` rule in the `120886317861****` member account of the `ca-5b6c626622af008f****` account group. The ID of the region where the resource resides is `cn-beijing`, and the type of the resource is `ACS::SLB::LoadBalancer`.
 *
 * @param tmpReq IgnoreAggregateEvaluationResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return IgnoreAggregateEvaluationResultsResponse
 */
async function ignoreAggregateEvaluationResultsWithOptions(tmpReq: IgnoreAggregateEvaluationResultsRequest, runtime: Util.RuntimeOptions): IgnoreAggregateEvaluationResultsResponse {
  Util.validateModel(tmpReq);
  var request = new IgnoreAggregateEvaluationResultsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resources)) {
    request.resourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resources, 'Resources', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleId)) {
    body['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.ignoreDate)) {
    body['IgnoreDate'] = request.ignoreDate;
  }
  if (!Util.isUnset(request.reason)) {
    body['Reason'] = request.reason;
  }
  if (!Util.isUnset(request.resourcesShrink)) {
    body['Resources'] = request.resourcesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'IgnoreAggregateEvaluationResults',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Ignores the evaluation results of some resources in an account group based on a specific rule. You can also specify a time period for ignoring the evaluation results. After the period elapses, the evaluation results of the resources based on the rule are automatically displayed.
 *
 * @description After you ignore a resource that is evaluated as incompliant by using a rule, the resource is still evaluated by using the rule, but the compliance result is Ignored.
 * This example shows how to ignore the `lb-hp3a3b4ztyfm2plgm****` incompliant resource that is evaluated by using the `cr-7e72626622af0051***` rule in the `120886317861****` member account of the `ca-5b6c626622af008f****` account group. The ID of the region where the resource resides is `cn-beijing`, and the type of the resource is `ACS::SLB::LoadBalancer`.
 *
 * @param request IgnoreAggregateEvaluationResultsRequest
 * @return IgnoreAggregateEvaluationResultsResponse
 */
async function ignoreAggregateEvaluationResults(request: IgnoreAggregateEvaluationResultsRequest): IgnoreAggregateEvaluationResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return ignoreAggregateEvaluationResultsWithOptions(request, runtime);
}

model IgnoreEvaluationResultsRequest {
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-7e72626622af0051****'),
  ignoreDate?: string(name='IgnoreDate', description='The date from which the system automatically re-evaluates the ignored incompliant resources.

>  If you leave this parameter empty, the system does not automatically re-evaluate the ignored incompliant resources. You must manually re-evaluate the ignored incompliant resources.', example='2022-06-01'),
  reason?: string(name='Reason', description='The reason why you want to ignore the resource.', example='Test ignore.'),
  resources?: [ 
    {
      region?: string(name='Region', description='The ID of the region in which the resource resides.

For more information about how to obtain the ID of the region in which a resource resides, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='cn-beijing'),
      resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resources belong.

This parameter is required.', example='100931896542****'),
      resourceId?: string(name='ResourceId', description='The ID of the resource.

For more information about how to obtain the ID of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='lb-hp3a3b4ztyfm2plgm****'),
      resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to obtain the type of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='ACS::SLB::LoadBalancer'),
    }
  ](name='Resources', description='The resources to be ignored.

This parameter is required.'),
}

model IgnoreEvaluationResultsShrinkRequest {
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-7e72626622af0051****'),
  ignoreDate?: string(name='IgnoreDate', description='The date from which the system automatically re-evaluates the ignored incompliant resources.

>  If you leave this parameter empty, the system does not automatically re-evaluate the ignored incompliant resources. You must manually re-evaluate the ignored incompliant resources.', example='2022-06-01'),
  reason?: string(name='Reason', description='The reason why you want to ignore the resource.', example='Test ignore.'),
  resourcesShrink?: string(name='Resources', description='The resources to be ignored.

This parameter is required.'),
}

model IgnoreEvaluationResultsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1840CBF2-0B0B-59F2-9E84-07B38267A279'),
}

model IgnoreEvaluationResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: IgnoreEvaluationResultsResponseBody(name='body'),
}

/**
 * @summary Ignores the evaluation results of some resources based on a specific rule. You can also specify a time period for ignoring the evaluation results. After the period elapses, the evaluation results of the resources based on the rule are automatically displayed.
 *
 * @description After you ignore a resource that is evaluated as incompliant by using a rule, the resource is still evaluated by using the rule, but the compliance result is Ignored.
 * This example shows how to ignore the `lb-hp3a3b4ztyfm2plgm****` resource that is evaluated as incompliant by using the `cr-7e72626622af0051****` rule in the `100931896542****` account. The ID of the region in which the resource resides is `cn-beijing`, and the type of the resource is `ACS::SLB::LoadBalancer`.
 *
 * @param tmpReq IgnoreEvaluationResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return IgnoreEvaluationResultsResponse
 */
async function ignoreEvaluationResultsWithOptions(tmpReq: IgnoreEvaluationResultsRequest, runtime: Util.RuntimeOptions): IgnoreEvaluationResultsResponse {
  Util.validateModel(tmpReq);
  var request = new IgnoreEvaluationResultsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resources)) {
    request.resourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resources, 'Resources', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.configRuleId)) {
    body['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.ignoreDate)) {
    body['IgnoreDate'] = request.ignoreDate;
  }
  if (!Util.isUnset(request.reason)) {
    body['Reason'] = request.reason;
  }
  if (!Util.isUnset(request.resourcesShrink)) {
    body['Resources'] = request.resourcesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'IgnoreEvaluationResults',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Ignores the evaluation results of some resources based on a specific rule. You can also specify a time period for ignoring the evaluation results. After the period elapses, the evaluation results of the resources based on the rule are automatically displayed.
 *
 * @description After you ignore a resource that is evaluated as incompliant by using a rule, the resource is still evaluated by using the rule, but the compliance result is Ignored.
 * This example shows how to ignore the `lb-hp3a3b4ztyfm2plgm****` resource that is evaluated as incompliant by using the `cr-7e72626622af0051****` rule in the `100931896542****` account. The ID of the region in which the resource resides is `cn-beijing`, and the type of the resource is `ACS::SLB::LoadBalancer`.
 *
 * @param request IgnoreEvaluationResultsRequest
 * @return IgnoreEvaluationResultsResponse
 */
async function ignoreEvaluationResults(request: IgnoreEvaluationResultsRequest): IgnoreEvaluationResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return ignoreEvaluationResultsWithOptions(request, runtime);
}

model ListAggregateCompliancePacksRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.

Valid values: 1 to 100. Default value: 10.', example='20'),
  status?: string(name='Status', description='The status of the one or more compliance packages to be queried. Valid values:

*   ACTIVE: compliance packages that are available for use.
*   CREATING: compliance packages that are being created.', example='ACTIVE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags.'),
}

model ListAggregateCompliancePacksShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.

Valid values: 1 to 100. Default value: 10.', example='20'),
  status?: string(name='Status', description='The status of the one or more compliance packages to be queried. Valid values:

*   ACTIVE: compliance packages that are available for use.
*   CREATING: compliance packages that are being created.', example='ACTIVE'),
  tagShrink?: string(name='Tag', description='The tags.'),
}

model ListAggregateCompliancePacksResponseBody = {
  compliancePacksResult?: {
    compliancePacks?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the management account to which the compliance package belongs.', example='100931896542****'),
        aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-f632626622af0079****'),
        compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-fdc8626622af00f9****'),
        compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='example-name'),
        compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template.', example='ct-5f26ff4e06a300c4****'),
        createTimestamp?: long(name='CreateTimestamp', description='The timestamp when the compliance package was created. Unit: milliseconds.', example='1624243657000'),
        description?: string(name='Description', description='The description of the compliance package.', example='example-description'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the managed rules in the compliance package. Valid values:

*   1: high risk level.
*   2: medium risk level.
*   3: low risk level.', example='1'),
        status?: string(name='Status', description='The status of the compliance package. Valid values:

*   ACTIVE: The compliance package is available for use.
*   CREATING: The compliance package is being created.', example='ACTIVE'),
        tags?: [ 
          {
            tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
            tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
          }
        ](name='Tags', description='The tags.'),
      }
    ](name='CompliancePacks', description='The compliance packages.'),
    pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
    totalCount?: long(name='TotalCount', description='The total number of compliance packages returned.', example='1'),
  }(name='CompliancePacksResult', description='The compliance packages returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B5806142-3090-4F86-A84E-12B3FE52C1C4'),
}

model ListAggregateCompliancePacksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateCompliancePacksResponseBody(name='body'),
}

/**
 * @summary Queries a list of compliance packages in an account group.
 *
 * @description In this topic, the `ca-f632626622af0079****` account group is used as an example. The return result shows one compliance package whose ID is `cp-fdc8626622af00f9****`.
 *
 * @param tmpReq ListAggregateCompliancePacksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateCompliancePacksResponse
 */
async function listAggregateCompliancePacksWithOptions(tmpReq: ListAggregateCompliancePacksRequest, runtime: Util.RuntimeOptions): ListAggregateCompliancePacksResponse {
  Util.validateModel(tmpReq);
  var request = new ListAggregateCompliancePacksShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateCompliancePacks',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of compliance packages in an account group.
 *
 * @description In this topic, the `ca-f632626622af0079****` account group is used as an example. The return result shows one compliance package whose ID is `cp-fdc8626622af00f9****`.
 *
 * @param request ListAggregateCompliancePacksRequest
 * @return ListAggregateCompliancePacksResponse
 */
async function listAggregateCompliancePacks(request: ListAggregateCompliancePacksRequest): ListAggregateCompliancePacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateCompliancePacksWithOptions(request, runtime);
}

model ListAggregateConfigDeliveryChannelsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  deliveryChannelIds?: string(name='DeliveryChannelIds', description='The IDs of the delivery channels. Separate multiple IDs with commas (,).', example='cdc-d9106457e0d900b1****'),
}

model ListAggregateConfigDeliveryChannelsResponseBody = {
  deliveryChannels?: [ 
    {
      accountId?: long(name='AccountId', description='The ID of the member in the account group.', example='120886317861****'),
      aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-a4e5626622af0079****'),
      compliantSnapshot?: boolean(name='CompliantSnapshot', description='Indicates whether the specified destination receives scheduled compliant snapshots. Cloud Config delivers scheduled compliant snapshots at `04:00Z` and `16:00Z` to Log Service every day. The time is displayed in UTC. Valid values:

*   true: The specified destination receives scheduled compliant snapshots.
*   false: The specified destination does not receive scheduled compliant snapshots.', example='false'),
      configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Indicates whether the specified destination receives resource change logs. If the value of this parameter is true, Cloud Config delivers the resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true: The specified destination receives resource change logs.
*   false: The specified destination does not receive resource change logs.', example='true'),
      configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Indicates whether the specified destination receives scheduled resource snapshots. Cloud Config delivers scheduled resource snapshots at `04:00Z` and `16:00Z` to OSS, MNS, or Log Service every day. The time is displayed in UTC. Valid values:

*   true: The specified destination receives scheduled resource snapshots.
*   false: The specified destination does not receive scheduled resource snapshots.', example='false'),
      deliveryChannelAssumeRoleArn?: string(name='DeliveryChannelAssumeRoleArn', description='The ARN of the role that is assigned to the delivery channel.', example='acs:ram::120886317861****:role/aliyunserviceroleforconfig'),
      deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that is attached to the delivery channel. This parameter is available when you deliver data of all types to MNS or deliver snapshots to Log Service.

*   If the value of the DeliveryChannelType parameter is MNS, take note of the following settings of the lowest risk level and resource types of the events to which you subscribed:

    *   The lowest risk level of the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

        The `value` field indicates the risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

    *   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

        The `values` field indicates the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`

*   If you set the DeliveryChannelType parameter to SLS, the setting of the resource types of the snapshots to which you want to deliver is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the snapshots to which you want to deliver. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
      deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-d9106457e0d900b1****'),
      deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.', example='myDeliveryChannel'),
      deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The ARN of the delivery destination.

*   If the value of the DeliveryChannelType parameter is OSS, the value of this parameter is the ARN of the destination OSS bucket.
*   If the value of the DeliveryChannelType parameter is MNS, the value of this parameter is the ARN of the destination MNS topic.
*   If the value of the DeliveryChannelType parameter is SLS, the value of this parameter is the ARN of the destination Log Service Logstore.', example='acs:oss:cn-shanghai:120886317861****:new-bucket'),
      deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery channel. Valid values:

*   OSS: Object Storage Service (OSS)
*   MNS: Message Service (MNS)
*   SLS: Log Service', example='OSS'),
      deliverySnapshotTime?: string(name='DeliverySnapshotTime', description='The time when Cloud Config delivers scheduled resources snapshots every day.

Format: `HH:mmZ`. This time is displayed in UTC.', example='09:10Z'),
      description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
      nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Indicates whether the specified destination receives resource non-compliance events. If the value of this parameter is true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are evaluated as non-compliant. Valid values:

*   true: The specified destination receives resource non-compliance events.
*   false: The specified destination does not receive resource non-compliance events.', example='false'),
      oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which the delivered data is transferred when the size of the data exceeds the specified upper limit of the delivery channel.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
      status?: int32(name='Status', description='The status of the delivery channel. Valid values:

*   0: The delivery channel is disabled.
*   1: The delivery channel is enabled.', example='1'),
    }
  ](name='DeliveryChannels', description='The information about the delivery channels.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DC300244-FCE3-5061-8214-C27ECB668487'),
}

model ListAggregateConfigDeliveryChannelsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateConfigDeliveryChannelsResponseBody(name='body'),
}

/**
 * @summary Queries the information about all delivery channels in an account group.
 *
 * @param request ListAggregateConfigDeliveryChannelsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateConfigDeliveryChannelsResponse
 */
async function listAggregateConfigDeliveryChannelsWithOptions(request: ListAggregateConfigDeliveryChannelsRequest, runtime: Util.RuntimeOptions): ListAggregateConfigDeliveryChannelsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.deliveryChannelIds)) {
    query['DeliveryChannelIds'] = request.deliveryChannelIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateConfigDeliveryChannels',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about all delivery channels in an account group.
 *
 * @param request ListAggregateConfigDeliveryChannelsRequest
 * @return ListAggregateConfigDeliveryChannelsResponse
 */
async function listAggregateConfigDeliveryChannels(request: ListAggregateConfigDeliveryChannelsRequest): ListAggregateConfigDeliveryChannelsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateConfigDeliveryChannelsWithOptions(request, runtime);
}

model ListAggregateConfigRuleEvaluationResultsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-b1e6626622af00cb****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).', example='cp-f1e3326622af00cb****'),
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to your resource.
*   INSUFFICIENT_DATA: No data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='NON_COMPLIANT'),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to query the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='cr-888f626622af00ae****'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return in a request. Valid values: 1 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of `NextToken`.', example='IWBjqMYSy0is7zSMGu16****'),
  regions?: string(name='Regions', description='The ID of the region whose resources you want to evaluate. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  resourceAccountId?: long(name='ResourceAccountId', description='Member accountId to which the resource to be queried belongs.', example='100931896542****'),
  resourceGroupIds?: string(name='ResourceGroupIds', description='The ID of the resource group whose resources you want to evaluate. Separate multiple resource group IDs with commas (,).', example='rg-aek2cqyzvuj****'),
  resourceOwnerId?: long(name='ResourceOwnerId', deprecated=true),
  resourceTypes?: string(name='ResourceTypes', description='The type of the resources that you want to evaluate. Separate multiple resource types with commas (,).', example='ACS::ECS::Instance'),
}

model ListAggregateConfigRuleEvaluationResultsResponseBody = {
  evaluationResults?: {
    evaluationResultList?: [ 
      {
        annotation?: string(name='Annotation', description='The annotation to the resource that is evaluated as non-compliant. The following parameters may be returned:

*   `configuration`: the current resource configuration that is evaluated as incompliant by using the rule.
*   `desiredValue`: the expected resource configuration that is evaluated as compliant.
*   `operator`: the operator that compares the current configuration with the expected configuration of the resource.
*   `property`: the JSON path of the current configuration in the resource property struct.
*   `reason`: the reason why the resource is evaluated as non-compliant.', example='{\\\\"configuration\\\\":\\\\"LRS\\\\",\\\\"desiredValue\\\\":\\\\"ZRS\\\\",\\\\"operator\\\\":\\\\"StringEquals\\\\",\\\\"property\\\\":\\\\"$.DataRedundancyType\\\\"}'),
        complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to your resource.
*   INSUFFICIENT_DATA: No data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='NON_COMPLIANT'),
        configRuleInvokedTimestamp?: long(name='ConfigRuleInvokedTimestamp', description='The timestamp when the rule was triggered for the compliance evaluation. Unit: milliseconds.', example='1624869012713'),
        evaluationId?: string(name='EvaluationId', example='00000089-4e0d-58b5-a96a-8e54112110f3'),
        evaluationResultIdentifier?: {
          evaluationResultQualifier?: {
            compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package to which the rule belongs.', example='cr-7263fd26622af00bc****'),
            configRuleArn?: string(name='ConfigRuleArn', description='The ARN of the rule.', example='acs:config::100931896542****:rule/cr-888f626622af00ae****'),
            configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-888f626622af00ae****'),
            configRuleName?: string(name='ConfigRuleName', description='The rule name.', example='test-rule-name'),
            ignoreDate?: string(name='IgnoreDate', description='The date on which the system automatically re-evaluates the ignored incompliant resources.

>  If the value of this parameter is left empty, the system does not automatically re-evaluate the ignored incompliant resources. You must manually re-evaluate the ignored incompliant resources.', example='2022-06-01'),
            regionId?: string(name='RegionId', description='The ID of the region in which your resources reside.', example='cn-hangzhou'),
            resourceId?: string(name='ResourceId', description='The resource ID.', example='Bucket-test'),
            resourceName?: string(name='ResourceName', description='The resource name.', example='Bucket-test'),
            resourceOwnerId?: long(name='ResourceOwnerId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='173808452267****'),
            resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::OSS::Bucket'),
          }(name='EvaluationResultQualifier', description='The information about the evaluated resource in the compliance evaluation result.'),
          orderingTimestamp?: long(name='OrderingTimestamp', description='The timestamp when the compliance evaluation was performed. Unit: milliseconds.

>  This timestamp indicates the time when the rule was triggered. You can obtain the timestamp from the `ConfigRuleInvokedTimestamp` parameter.', example='1624869012713'),
        }(name='EvaluationResultIdentifier', description='The identifying information about the compliance evaluation result.'),
        invokingEventMessageType?: string(name='InvokingEventMessageType', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.', example='ScheduledNotification'),
        lastNonCompliantRecordTimestamp?: long(name='LastNonCompliantRecordTimestamp', example='1744696393000'),
        remediationEnabled?: boolean(name='RemediationEnabled', description='Indicates whether the remediation template is enabled. Valid values:

*   true
*   false', example='false'),
        resultRecordedTimestamp?: long(name='ResultRecordedTimestamp', description='The timestamp when the compliance evaluation result was recorded. The value of this parameter is a UNIX timestamp in milliseconds.', example='1624869013065'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium.
*   3: low.', example='1'),
      }
    ](name='EvaluationResultList', description='The details of the compliance evaluation result.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned on each page.', example='10'),
    nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='IWBjqMYSy0is7zSMGu16****'),
  }(name='EvaluationResults', description='The information about the compliance evaluation results returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='A6662516-D056-4325-B6A7-CD3E89C97C39'),
}

model ListAggregateConfigRuleEvaluationResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateConfigRuleEvaluationResultsResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation results of resources based on a rule in an account group.
 *
 * @description This topic provides an example on how to query the compliance evaluation results of resources based on the `cr-888f626622af00ae****` rule in the `ca-d1e3326622af00cb****` account group. The returned result indicates that the `Bucket-test` resource is evaluated as `NON_COMPLIANT` by using the rule. The resource is an Object Storage Service (OSS) bucket.
 *
 * @param request ListAggregateConfigRuleEvaluationResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateConfigRuleEvaluationResultsResponse
 */
async function listAggregateConfigRuleEvaluationResultsWithOptions(request: ListAggregateConfigRuleEvaluationResultsRequest, runtime: Util.RuntimeOptions): ListAggregateConfigRuleEvaluationResultsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.complianceType)) {
    query['ComplianceType'] = request.complianceType;
  }
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regions)) {
    query['Regions'] = request.regions;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  if (!Util.isUnset(request.resourceGroupIds)) {
    query['ResourceGroupIds'] = request.resourceGroupIds;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateConfigRuleEvaluationResults',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation results of resources based on a rule in an account group.
 *
 * @description This topic provides an example on how to query the compliance evaluation results of resources based on the `cr-888f626622af00ae****` rule in the `ca-d1e3326622af00cb****` account group. The returned result indicates that the `Bucket-test` resource is evaluated as `NON_COMPLIANT` by using the rule. The resource is an Object Storage Service (OSS) bucket.
 *
 * @param request ListAggregateConfigRuleEvaluationResultsRequest
 * @return ListAggregateConfigRuleEvaluationResultsResponse
 */
async function listAggregateConfigRuleEvaluationResults(request: ListAggregateConfigRuleEvaluationResultsRequest): ListAggregateConfigRuleEvaluationResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateConfigRuleEvaluationResultsWithOptions(request, runtime);
}

model ListAggregateConfigRuleEvaluationStatisticsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-edd3626622af00b3****'),
}

model ListAggregateConfigRuleEvaluationStatisticsResponseBody = {
  evaluationResults?: [ 
    {
      aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-edd3626622af00b3****'),
      nonCompliantResourceCnt?: int32(name='NonCompliantResourceCnt', description='The number of resources that are evaluated as non-compliant.', example='25'),
      nonCompliantRuleCnt?: int32(name='NonCompliantRuleCnt', description='The number of rules based on which resources are evaluated as non-compliant.', example='3'),
      statisticDate?: string(name='StatisticDate', description='The date on which the statistics are obtained.', example='2023-06-27'),
      totalResourceCnt?: int32(name='TotalResourceCnt', description='The total number of resources.', example='153'),
      totalRuleCnt?: int32(name='TotalRuleCnt', description='The total number of rules.', example='10'),
    }
  ](name='EvaluationResults', description='The statistics of compliance evaluation results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9EFA436B-FC6F-513B-9DB8-C96E6CEBE5E0'),
}

model ListAggregateConfigRuleEvaluationStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateConfigRuleEvaluationStatisticsResponseBody(name='body'),
}

/**
 * @summary Queries the statistics of compliance evaluation results of an account group.
 *
 * @description This topic provides an example on how to query the statistics of compliance evaluation results of an account group whose ID is ca-edd3626622af00b3\\*\\*\\*\\*.
 *
 * @param request ListAggregateConfigRuleEvaluationStatisticsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateConfigRuleEvaluationStatisticsResponse
 */
async function listAggregateConfigRuleEvaluationStatisticsWithOptions(request: ListAggregateConfigRuleEvaluationStatisticsRequest, runtime: Util.RuntimeOptions): ListAggregateConfigRuleEvaluationStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateConfigRuleEvaluationStatistics',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics of compliance evaluation results of an account group.
 *
 * @description This topic provides an example on how to query the statistics of compliance evaluation results of an account group whose ID is ca-edd3626622af00b3\\*\\*\\*\\*.
 *
 * @param request ListAggregateConfigRuleEvaluationStatisticsRequest
 * @return ListAggregateConfigRuleEvaluationStatisticsResponse
 */
async function listAggregateConfigRuleEvaluationStatistics(request: ListAggregateConfigRuleEvaluationStatisticsRequest): ListAggregateConfigRuleEvaluationStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateConfigRuleEvaluationStatisticsWithOptions(request, runtime);
}

model ListAggregateConfigRulesRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='cp-fe416457e0d90022****'),
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No data is available.', example='COMPLIANT'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='test-rule-name'),
  configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:

*   ACTIVE: The rule is being used to monitor resource configurations.
*   DELETING: The rule is being deleted.
*   EVALUATING: The rule is triggered and is being used to monitor resource configurations.
*   INACTIVE: The rule is disabled.', example='ACTIVE'),
  keyword?: string(name='Keyword', description='The keyword that is used for queries.

You can perform a fuzzy search by rule ID, rule name, rule description, or managed rule ID.', example='ecs'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 100. Minimum value: 1. Default value: 10', example='10'),
  resourceTypes?: string(name='ResourceTypes', description='Resource type for the rule to evaluate.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.

You can specify at most 20 tag keys.', example='key-1'),
      value?: string(name='Value', description='The value of the tag. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. The tag value cannot contain `http://` or `https://`.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListAggregateConfigRulesShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='cp-fe416457e0d90022****'),
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No data is available.', example='COMPLIANT'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='test-rule-name'),
  configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:

*   ACTIVE: The rule is being used to monitor resource configurations.
*   DELETING: The rule is being deleted.
*   EVALUATING: The rule is triggered and is being used to monitor resource configurations.
*   INACTIVE: The rule is disabled.', example='ACTIVE'),
  keyword?: string(name='Keyword', description='The keyword that is used for queries.

You can perform a fuzzy search by rule ID, rule name, rule description, or managed rule ID.', example='ecs'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 100. Minimum value: 1. Default value: 10', example='10'),
  resourceTypes?: string(name='ResourceTypes', description='Resource type for the rule to evaluate.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListAggregateConfigRulesResponseBody = {
  configRules?: {
    configRuleList?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the management account to which the rules belong.', example='100931896542****'),
        automationType?: string(name='AutomationType', description='The type of the remediation template. Only OOS is returned, which indicates CloudOps Orchestration Service.', example='OOS'),
        compliance?: {
          complianceType?: string(name='ComplianceType', description='The compliance evaluation result. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No data is available.', example='COMPLIANT'),
          count?: int32(name='Count', description='The number of evaluation resources that correspond to the summary result of the rule compliance evaluation.', example='2'),
        }(name='Compliance', description='The compliance evaluation result.'),
        configRuleArn?: string(name='ConfigRuleArn', description='The ARN of the rule.', example='acs:config::100931896542****:rule/cr-fdc8626622af00f9****'),
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-fdc8626622af00f9****'),
        configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='test-rule-name'),
        configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:

*   ACTIVE: The rule is being used to monitor resource configurations.
*   DELETING: The rule is being deleted.
*   EVALUATING: The rule is triggered and is being used to monitor resource configurations.
*   INACTIVE: The rule is disabled.', example='ACTIVE'),
        createBy?: {
          aggregatorId?: string(name='AggregatorId', description='The account group ID.', example='ca-f632626622af0079****'),
          aggregatorName?: string(name='AggregatorName', description='The name of the account group.', example='Test_Group'),
          compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='cp-fdc8626622af00f9****'),
          compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='test-pack-name'),
          creatorId?: string(name='CreatorId', description='The ID of the management account that created the rule.', example='100931896542****'),
          creatorName?: string(name='CreatorName', description='The name of the management account that create the rule.', example='Alice'),
          creatorType?: string(name='CreatorType', description='The type of the creator of the rule. The value is fixed to AGGREGATOR, which indicates an account group.', example='AGGREGATOR'),
        }(name='CreateBy', description='The information about the creation of the rule.'),
        description?: string(name='Description', description='The description of the rule.', example='The description of the test rule.'),
        resourceTypesScope?: string(name='ResourceTypesScope', description='The types of resources evaluated by the rule. Multiple resource types are separated with commas (,).', example='ACS::EIP::EipAddress'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
        sourceIdentifier?: string(name='SourceIdentifier', description='The identifier of the rule.

*   If the rule is a managed rule, the value of this parameter is the name of the managed rule.
*   If the rule is a custom rule, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of a function.', example='eip-bandwidth-limit'),
        sourceOwner?: string(name='SourceOwner', description='The type of the rule. Valid values:

*   CUSTOM_FC: a custom rule.
*   ALIYUN: a managed rule.', example='ALIYUN'),
        tags?: [ 
          {
            key?: string(name='Key', description='The tag key of the rule.', example='env'),
            value?: string(name='Value', description='The tag value of the rule.', example='prod'),
          }
        ](name='Tags', description='The tags of the rule.'),
      }
    ](name='ConfigRuleList', description='The details of the rule.'),
    pageNumber?: int32(name='PageNumber', description='The number of the page returned.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
    totalCount?: long(name='TotalCount', description='The total number of rules.', example='1'),
  }(name='ConfigRules', description='The queried rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='22EF8287-2C9A-4F1F-80A6-CEFA7612689D'),
}

model ListAggregateConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateConfigRulesResponseBody(name='body'),
}

/**
 * @summary Queries a list of rules in an account group.
 *
 * @description This topic provides an example on how to query the rules in an account group whose ID is `ca-f632626622af0079****`. The returned result shows a total of one rule and two evaluated resources. The resources are both evaluated as `COMPLIANT`.
 *
 * @param tmpReq ListAggregateConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateConfigRulesResponse
 */
async function listAggregateConfigRulesWithOptions(tmpReq: ListAggregateConfigRulesRequest, runtime: Util.RuntimeOptions): ListAggregateConfigRulesResponse {
  Util.validateModel(tmpReq);
  var request = new ListAggregateConfigRulesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.complianceType)) {
    query['ComplianceType'] = request.complianceType;
  }
  if (!Util.isUnset(request.configRuleName)) {
    query['ConfigRuleName'] = request.configRuleName;
  }
  if (!Util.isUnset(request.configRuleState)) {
    query['ConfigRuleState'] = request.configRuleState;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  if (!Util.isUnset(request.riskLevel)) {
    query['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of rules in an account group.
 *
 * @description This topic provides an example on how to query the rules in an account group whose ID is `ca-f632626622af0079****`. The returned result shows a total of one rule and two evaluated resources. The resources are both evaluated as `COMPLIANT`.
 *
 * @param request ListAggregateConfigRulesRequest
 * @return ListAggregateConfigRulesResponse
 */
async function listAggregateConfigRules(request: ListAggregateConfigRulesRequest): ListAggregateConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateConfigRulesWithOptions(request, runtime);
}

model ListAggregateDiscoveredResourcesRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-c560626622af0005****'),
  endUpdateTimestamp?: long(name='EndUpdateTimestamp', description='The end time of the time range for querying resources. The value is a timestamp in the UTC format. When you specify this parameter, take note of the following limits:

*   The value must be a timestamp in milliseconds.
*   The value cannot be less than the value of the StartUpdateTimestamp parameter. The interval between the value and the value of the StartUpdateTimestamp parameter must be less than or equal to 30 days.
*   The StartUpdateTimestamp and EndUpdateTimestamp parameters must be specified at the same time or left empty at the same time.', example='1724947200000'),
  excludeResourceTypes?: string(name='ExcludeResourceTypes', description='The types of resources that are excluded. Separate multiple values with commas (,). If this parameter conflicts with the ResourceTypes parameter, this parameter prevails.', example='ACS::ECS::Instance,ACS::ECS::NetworkInterface'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 1 to 100.

This parameter is required.', example='10'),
  nextToken?: string(name='NextToken', description='The `token` that you want to use to initiate the current request. If the response of the previous request is truncated, you can use this token to initiate another request and obtain the remaining entries.', example='IWBjqMYSy0is7zSMGu16****', nullable=false),
  regions?: string(name='Regions', description='The ID of the region in which the resource resides. Separate multiple region IDs with commas (,).', example='cn-huhehaote'),
  resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the specified resource belongs in the account group.', example='100931896542****'),
  resourceDeleted?: int32(name='ResourceDeleted', description='The status of the resource. Valid values:

*   0: The resource is deleted. If a resource is deleted from the desired cloud service, **Deleted** is displayed in the resource list in the Cloud Config console.
*   1 (default): The resource is retained. If a resource is managed as expected, **Active** is displayed in the resource list in the Cloud Config console.', example='1'),
  resourceId?: string(name='ResourceId', description='The resource ID.', example='eni-hp31cqoba96jagtz****'),
  resourceOwnerId?: long(name='ResourceOwnerId', deprecated=true),
  resourceTypes?: string(name='ResourceTypes', description='The type of the resource. Separate multiple resource types with commas (,).', example='ACS::ECS::NetworkInterface'),
  startUpdateTimestamp?: long(name='StartUpdateTimestamp', description='The start time of the time range for querying resources. The value is a timestamp in the Coordinated Universal Time (UTC) format. When you specify this parameter, take note of the following limits:

*   The value must be a timestamp in milliseconds.
*   The value cannot be greater than the value of the EndUpdateTimestamp parameter. The interval between the value and the value of the EndUpdateTimestamp parameter must be less than or equal to 30 days.
*   The StartUpdateTimestamp and EndUpdateTimestamp parameters must be specified at the same time or left empty at the same time.', example='1722441600000'),
}

model ListAggregateDiscoveredResourcesResponseBody = {
  discoveredResourceProfiles?: {
    discoveredResourceProfileList?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs. We recommend that you use the ResourceOwnerId parameter.', example='161259599160****'),
        availabilityZone?: string(name='AvailabilityZone', description='The ID of the zone in which the resource resides.', example='cn-huhehaote-a'),
        region?: string(name='Region', description='The region ID.', example='cn-huhehaote'),
        resourceCreationTime?: long(name='ResourceCreationTime', description='The time when the resource was created. Unit: milliseconds.', example='1618675206000'),
        resourceDeleted?: int32(name='ResourceDeleted', description='The status of the resource. Valid values:

*   0: The resource is deleted.
*   1: The resource is retained.', example='1'),
        resourceId?: string(name='ResourceId', description='The resource ID.', example='eni-hp31cqoba96jagtz****'),
        resourceName?: string(name='ResourceName', description='The resource name.', example='Cloud Firewall'),
        resourceOwnerId?: long(name='ResourceOwnerId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='161259599160****'),
        resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The value of this parameter varies with the resource type and may be empty. Examples:

*   If the value of the ResourceType parameter is ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that is in a specific state. In this case, the valid values of this parameter are Running and Stopped.
*   If the value of the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that is not in a specific state. In this case, this parameter is empty.', example='InUse'),
        resourceType?: string(name='ResourceType', description='The resource type.', example='ACS::ECS::NetworkInterface'),
        tags?: string(name='Tags', description='The tags of the resource.', example='{\\\\"key1\\\\":[\\\\"value2\\\\"]}'),
        updateTime?: long(name='UpdateTime', description='The time when the resource was last updated. The value must be a timestamp in milliseconds.', example='1722441600000'),
        version?: long(name='Version', description='The build version of the resource.', example='1'),
      }
    ](name='DiscoveredResourceProfileList', description='The details of the resources.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned on each page.', example='10'),
    nextToken?: string(name='NextToken', description='The token that was used to initiate the next request.', example='IWBjqMYSy0is7zSMGu16****'),
    totalCount?: int32(name='TotalCount', description='The total number of resources.', example='8'),
  }(name='DiscoveredResourceProfiles', description='The information about the resources.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}

model ListAggregateDiscoveredResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateDiscoveredResourcesResponseBody(name='body'),
}

/**
 * @summary Obtains a list of resources aggregated across regions within all member accounts of a specific account group.
 *
 * @description This topic provides an example on how to query the resources within the member account `100931896542****` of the account group `ca-c560626622af0005****`. The result indicates that eight resources are queried.
 *
 * @param request ListAggregateDiscoveredResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateDiscoveredResourcesResponse
 */
async function listAggregateDiscoveredResourcesWithOptions(request: ListAggregateDiscoveredResourcesRequest, runtime: Util.RuntimeOptions): ListAggregateDiscoveredResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.endUpdateTimestamp)) {
    query['EndUpdateTimestamp'] = request.endUpdateTimestamp;
  }
  if (!Util.isUnset(request.excludeResourceTypes)) {
    query['ExcludeResourceTypes'] = request.excludeResourceTypes;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regions)) {
    query['Regions'] = request.regions;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  if (!Util.isUnset(request.resourceDeleted)) {
    query['ResourceDeleted'] = request.resourceDeleted;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  if (!Util.isUnset(request.startUpdateTimestamp)) {
    query['StartUpdateTimestamp'] = request.startUpdateTimestamp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateDiscoveredResources',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains a list of resources aggregated across regions within all member accounts of a specific account group.
 *
 * @description This topic provides an example on how to query the resources within the member account `100931896542****` of the account group `ca-c560626622af0005****`. The result indicates that eight resources are queried.
 *
 * @param request ListAggregateDiscoveredResourcesRequest
 * @return ListAggregateDiscoveredResourcesResponse
 */
async function listAggregateDiscoveredResources(request: ListAggregateDiscoveredResourcesRequest): ListAggregateDiscoveredResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateDiscoveredResourcesWithOptions(request, runtime);
}

model ListAggregateRemediationExecutionsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-edd3626622af00b3****'),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-2792626622af0c21****'),
  executionStatus?: string(name='ExecutionStatus', description='The status of the remediation. Valid values:

*   Success
*   Failed', example='Success'),
  maxResults?: long(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 10 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='aVCjqFaSy0Ps6zSMGw09****'),
  resourceAccountId?: long(name='ResourceAccountId', description='The ID of the member account in the account group. When left unfilled, this rule queries the remediation result for the account that created the rule. If the account is not in the account group, the result will be empty.', example='126672004088****'),
}

model ListAggregateRemediationExecutionsResponseBody = {
  remediationExecutionData?: {
    maxResults?: long(name='MaxResults', description='The maximum number of entries returned for a single request.', example='10'),
    nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='cNclqNaKs0Ds7zSNip0a****'),
    remediationExecutions?: [ 
      {
        executionCreateDate?: string(name='ExecutionCreateDate', description='The time when the remediation record was created.', example='2023-06-25T11:48:15Z'),
        executionInvocationId?: string(name='ExecutionInvocationId', description='The invocation ID of the remediation record.', example='exec-befded3781994ccf****'),
        executionResourceIds?: string(name='ExecutionResourceIds', description='The IDs of the remediated resources. Multiple resource IDs are separated with commas (,).', example='rm-0jlk629z240l8****'),
        executionResourceType?: string(name='ExecutionResourceType', description='The resource type.', example='ACS::RDS::DBInstance'),
        executionStatus?: string(name='ExecutionStatus', description='The status of the remediation. Valid values:

*   Success
*   Failed', example='Success'),
        executionStatusMessage?: string(name='ExecutionStatusMessage', description='The error message returned when the remediation fails.', example='Invocation time out.'),
      }
    ](name='RemediationExecutions', description='The queried remediation records.'),
  }(name='RemediationExecutionData', description='The queried remediation records.'),
  requestId?: string(name='RequestId', description='The request ID.', example='13E67493-3165-529A-A961-BE9E4B11BA11'),
}

model ListAggregateRemediationExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateRemediationExecutionsResponseBody(name='body'),
}

/**
 * @summary Queries the remediation records of a rule in an account group.
 *
 * @description This topic provides an example on how to query the remediation records of the `cr-d04a626622af00af****` rule in the `ca-edd3626622af00b3****` account group.
 *
 * @param request ListAggregateRemediationExecutionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateRemediationExecutionsResponse
 */
async function listAggregateRemediationExecutionsWithOptions(request: ListAggregateRemediationExecutionsRequest, runtime: Util.RuntimeOptions): ListAggregateRemediationExecutionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.executionStatus)) {
    query['ExecutionStatus'] = request.executionStatus;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateRemediationExecutions',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the remediation records of a rule in an account group.
 *
 * @description This topic provides an example on how to query the remediation records of the `cr-d04a626622af00af****` rule in the `ca-edd3626622af00b3****` account group.
 *
 * @param request ListAggregateRemediationExecutionsRequest
 * @return ListAggregateRemediationExecutionsResponse
 */
async function listAggregateRemediationExecutions(request: ListAggregateRemediationExecutionsRequest): ListAggregateRemediationExecutionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateRemediationExecutionsWithOptions(request, runtime);
}

model ListAggregateRemediationsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-6b4a626622af0012****'),
  configRuleIds?: string(name='ConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-6b7c626622af00b4****'),
}

model ListAggregateRemediationsResponseBody = {
  remediations?: [ 
    {
      accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
      aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-6b4a626622af0012****'),
      configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-6b7c626622af00b4****'),
      invokeType?: string(name='InvokeType', description='The execution mode of the remediation template. Valid values:

*   NON_EXECUTION: The remediation template is not executed.
*   AUTO_EXECUTION: The remediation template is automatically executed.
*   MANUAL_EXECUTION: The remediation template is manually executed.
*   NOT_CONFIG: The execution mode is not specified.', example='AUTO_EXECUTION'),
      lastSuccessfulInvocationId?: string(name='LastSuccessfulInvocationId', description='The ID of the last successful execution of the remediation template.', example='bd7629fb-cac8-42fe-bcb1-e362c5a6****'),
      lastSuccessfulInvocationTime?: long(name='LastSuccessfulInvocationTime', description='The timestamp of the last successful execution of the remediation template. Unit: milliseconds.', example='1625451393589'),
      lastSuccessfulInvocationType?: string(name='LastSuccessfulInvocationType', description='The mode of the last successful execution of the remediation template. Valid values:

*   NON_EXECUTION: The remediation template is not executed.
*   AUTO_EXECUTION: The remediation template is automatically executed.
*   MANUAL_EXECUTION: The remediation template is manually executed.
*   NOT_CONFIG: The execution mode is not specified.', example='AUTO_EXECUTION'),
      remediaitonOriginParams?: string(name='RemediaitonOriginParams', description='The converted configuration of the remediation template. This parameter is returned only for an OOS remediation template.', example='{"bucketName": "{resourceId}", "regionId": "{regionId}", "permissionName": "private"}'),
      remediationId?: string(name='RemediationId', description='The ID of the remediation template.', example='crr-6b7c626622af0026****'),
      remediationSourceType?: string(name='RemediationSourceType', description='The source of remediation template. Valid values:

*   ALIYUN: official template.
*   CUSTOM: custom template.
*   NONE: none.', example='ALIYUN'),
      remediationTemplateId?: string(name='RemediationTemplateId', description='The ID of the remediation template.', example='ACS-OSS-PutBucketAcl'),
      remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid values:

*   OOS: Operation Orchestration Service (official remediation).
*   FC: Function Compute (custom remediation).', example='OOS'),
    }
  ](name='Remediations', description='An array that contains remediation templates.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0146963A-20C0-4E75-B93A-7D622B5FD7C8'),
}

model ListAggregateRemediationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateRemediationsResponseBody(name='body'),
}

/**
 * @summary Queries a list of remediation templates for a rule in an account group.
 *
 * @description This topic provides an example on how to query the remediation templates of the rule whose ID is `cr-6b7c626622af00b4****` in the account group whose ID is `ca-6b4a626622af0012****`.
 *
 * @param request ListAggregateRemediationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateRemediationsResponse
 */
async function listAggregateRemediationsWithOptions(request: ListAggregateRemediationsRequest, runtime: Util.RuntimeOptions): ListAggregateRemediationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateRemediations',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of remediation templates for a rule in an account group.
 *
 * @description This topic provides an example on how to query the remediation templates of the rule whose ID is `cr-6b7c626622af00b4****` in the account group whose ID is `ca-6b4a626622af0012****`.
 *
 * @param request ListAggregateRemediationsRequest
 * @return ListAggregateRemediationsResponse
 */
async function listAggregateRemediations(request: ListAggregateRemediationsRequest): ListAggregateRemediationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateRemediationsWithOptions(request, runtime);
}

model ListAggregateResourceEvaluationResultsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-7f00626622af0041****'),
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resource.
*   INSUFFICIENT_DATA: No data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='NON_COMPLIANT'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 1 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The token that you want to use to initiate the current request. If the response of the previous request is truncated, you can use this token to initiate another request and obtain the remaining entries.``', example='IWBjqMYSy0is7zSMGu16****'),
  region?: string(name='Region', description='The ID of the region where one or more resources that you want to query reside. For example, the value `global` indicates global regions and the value `cn-hangzhou` indicates the China (Hangzhou) region.

For more information about how to obtain the ID of a region, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).', example='global'),
  resourceId?: string(name='ResourceId', description='The ID of the resource.

For more information about how to obtain the ID of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).', example='23642660635396****'),
  resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to query the type of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).', example='ACS::RAM::User'),
}

model ListAggregateResourceEvaluationResultsResponseBody = {
  evaluationResults?: {
    evaluationResultList?: [ 
      {
        annotation?: string(name='Annotation', description='The annotation to the resource that is evaluated as incompliant.', example='{\\\\"configuration\\\\":\\\\"false\\\\",\\\\"desiredValue\\\\":\\\\"True\\\\",\\\\"operator\\\\":\\\\"StringEquals\\\\",\\\\"property\\\\":\\\\"$.LoginProfile.MFABindRequired\\\\"}'),
        complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resources. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as incompliant.
*   NOT_APPLICABLE: The rule does not apply to your resources.
*   INSUFFICIENT_DATA: No resource data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='NON_COMPLIANT'),
        configRuleInvokedTimestamp?: long(name='ConfigRuleInvokedTimestamp', description='The timestamp when the rule was triggered. Unit: milliseconds.', example='1624932227157'),
        evaluationId?: string(name='EvaluationId', example='00000089-4e0d-58b5-a96a-8e54112110f3'),
        evaluationResultIdentifier?: {
          evaluationResultQualifier?: {
            configRuleArn?: string(name='ConfigRuleArn', description='The Alibaba Cloud Resource Name (ARN) of the rule.', example='acs:config::100931896542****:rule/cr-7f7d626622af0041****'),
            configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-7f7d626622af0041****'),
            configRuleName?: string(name='ConfigRuleName', description='The name of the monitoring rule.', example='test-rule-name'),
            ignoreDate?: string(name='IgnoreDate', description='The date from which the system automatically re-evaluates the ignored incompliant resources.

>  If the value of this parameter is left empty, the system does not automatically re-evaluate the ignored incompliant resources. You must manually re-evaluate the ignored incompliant resources.', example='2022-06-01'),
            regionId?: string(name='RegionId', description='The ID of the region where the resource resides.', example='global'),
            resourceId?: string(name='ResourceId', description='The ID of the resource.', example='23642660635396****'),
            resourceName?: string(name='ResourceName', description='The name of the resource.', example='rd_member'),
            resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::RAM::User'),
          }(name='EvaluationResultQualifier', description='The information about the evaluated resource in the compliance evaluation result.'),
          orderingTimestamp?: long(name='OrderingTimestamp', description='The timestamp when the compliance evaluation was performed. Unit: milliseconds.', example='1624932227157'),
        }(name='EvaluationResultIdentifier', description='The identifying information about the compliance evaluation result.'),
        invokingEventMessageType?: string(name='InvokingEventMessageType', description='The trigger type of the managed rule. Valid values:

*   ConfigurationItemChangeNotification: The managed rule is triggered by configuration changes.
*   ScheduledNotification: The managed rule is periodically triggered.', example='ScheduledNotification'),
        lastNonCompliantRecordTimestamp?: long(name='LastNonCompliantRecordTimestamp', example='1744696665000'),
        remediationEnabled?: boolean(name='RemediationEnabled', description='Indicates whether the remediation template is enabled. Valid values:

- true: The remediation template is enabled.
- false: The remediation template is disabled.', example='false'),
        resultRecordedTimestamp?: long(name='ResultRecordedTimestamp', description='The timestamp when the compliance evaluation result was recorded. Unit: milliseconds.', example='1624932227595'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rule. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
      }
    ](name='EvaluationResultList', description='The details of the compliance evaluation result.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned on each page.', example='10'),
    nextToken?: string(name='NextToken', description='The token that was used to initiate the next request.', example='IWBjqMYSy0is7zSMGu16****'),
  }(name='EvaluationResults', description='The information about the compliance evaluation results returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25C89DDB-BB79-487D-88C3-4A561F21EFC4'),
}

model ListAggregateResourceEvaluationResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateResourceEvaluationResultsResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation results of resources in an account group.
 *
 * @description This example shows how to query the compliance evaluation result of the `23642660635396****` resource in the `ca-7f00626622af0041****` account group. The resource is a RAM user. The returned result indicates that the resource is evaluated as `NON_COMPLIANT` by using the `cr-7f7d626622af0041****` rule.
 *
 * @param request ListAggregateResourceEvaluationResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateResourceEvaluationResultsResponse
 */
async function listAggregateResourceEvaluationResultsWithOptions(request: ListAggregateResourceEvaluationResultsRequest, runtime: Util.RuntimeOptions): ListAggregateResourceEvaluationResultsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.complianceType)) {
    query['ComplianceType'] = request.complianceType;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateResourceEvaluationResults',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation results of resources in an account group.
 *
 * @description This example shows how to query the compliance evaluation result of the `23642660635396****` resource in the `ca-7f00626622af0041****` account group. The resource is a RAM user. The returned result indicates that the resource is evaluated as `NON_COMPLIANT` by using the `cr-7f7d626622af0041****` rule.
 *
 * @param request ListAggregateResourceEvaluationResultsRequest
 * @return ListAggregateResourceEvaluationResultsResponse
 */
async function listAggregateResourceEvaluationResults(request: ListAggregateResourceEvaluationResultsRequest): ListAggregateResourceEvaluationResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateResourceEvaluationResultsWithOptions(request, runtime);
}

model ListAggregateResourceRelationsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-856a626622af0033****'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 1 to 1000.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='AcBjqMYSy0is7zSMGu16****'),
  region?: string(name='Region', description='The ID of the region in which the resource resides.

This parameter is required.', example='cn-shanghai'),
  relationType?: string(name='RelationType', description='The type of the relationship between the resource and the object.

Valid values:

*   IsContained: The object is included as part of the resource.
*   IsAttachedTo: The object is added to the resource.
*   IsAssociatedIn: The object is associated with the resource.
*   Contains: The object contains the resource.', example='IsAttachedTo'),
  resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resources in the account group belong.

This parameter is required.', example='100931896542****'),
  resourceId?: string(name='ResourceId', description='The resource ID.

This parameter is required.', example='i-j6cajg9yrfoh4sas****'),
  resourceType?: string(name='ResourceType', description='The type of the resource.

This parameter is required.', example='ACS::ECS::Instance'),
  targetResourceId?: string(name='TargetResourceId', description='The ID of the resource that is associated with the object.', example='d-j6c8k731qbrc7fxi****'),
  targetResourceType?: string(name='TargetResourceType', description='The type of the resource that is associated with the object.', example='ACS::ECS::Disk'),
}

model ListAggregateResourceRelationsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='7A25F9DE-4C8B-5AD3-A241-FFF5A259E5A1'),
  resourceRelations?: {
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned on each page.', example='10'),
    nextToken?: string(name='NextToken', description='The token that was used to initiate the next request.', example='AcBjqMYSy0is7zSMGu16****'),
    resourceRelationList?: [ 
      {
        accountId?: long(name='AccountId', description='The Alibaba Cloud account ID of the resource owner.', example='100931896542****'),
        relationType?: string(name='RelationType', description='The type of the relationship between the resource and the object.

Valid values:

*   IsContained: The object is included as part of the resource.
*   IsAttachedTo: The object is added to the resource.
*   IsAssociatedIn: The object is associated with the resource.
*   Contains: The object contains the resource.', example='IsAttachedTo'),
        sourceResourceId?: string(name='SourceResourceId', description='The resource ID of the current resource.', example='i-j6cajg9yrfoh4sas****'),
        sourceResourceRegionId?: string(name='SourceResourceRegionId', description='The region ID of the current resource.', example='cn-shanghai'),
        sourceResourceType?: string(name='SourceResourceType', description='The type of the resource.', example='ACS::ECS::Instance'),
        targetResourceId?: string(name='TargetResourceId', description='The resource ID of the resource that is associated with the object.', example='d-j6c8k731qbrc7fxi****'),
        targetResourceType?: string(name='TargetResourceType', description='The type of the resource that is associated with the object.', example='ACS::ECS::Disk'),
      }
    ](name='ResourceRelationList', description='An array that contains the relationships.'),
  }(name='ResourceRelations', description='The result of the relationship.'),
}

model ListAggregateResourceRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateResourceRelationsResponseBody(name='body'),
}

/**
 * @summary Queries a list of the resources of a specific resource in an account group.
 *
 * @description This topic provides an example on how to query the disks that are associated with an Elastic Compute Service (ECS) instance in an account group.
 *
 * @param request ListAggregateResourceRelationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateResourceRelationsResponse
 */
async function listAggregateResourceRelationsWithOptions(request: ListAggregateResourceRelationsRequest, runtime: Util.RuntimeOptions): ListAggregateResourceRelationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.relationType)) {
    query['RelationType'] = request.relationType;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.targetResourceId)) {
    query['TargetResourceId'] = request.targetResourceId;
  }
  if (!Util.isUnset(request.targetResourceType)) {
    query['TargetResourceType'] = request.targetResourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateResourceRelations',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of the resources of a specific resource in an account group.
 *
 * @description This topic provides an example on how to query the disks that are associated with an Elastic Compute Service (ECS) instance in an account group.
 *
 * @param request ListAggregateResourceRelationsRequest
 * @return ListAggregateResourceRelationsResponse
 */
async function listAggregateResourceRelations(request: ListAggregateResourceRelationsRequest): ListAggregateResourceRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateResourceRelationsWithOptions(request, runtime);
}

model ListAggregateResourcesByAdvancedSearchRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

This parameter is required.', example='ca-4b05626622af000c****'),
  sql?: string(name='Sql', description='The SQL query statement.

This parameter is required.', example='SELECT ResourceId, ResourceName WHERE Tags.Kvpair=\\\\"business:online\\\\"'),
}

model ListAggregateResourcesByAdvancedSearchResponseBody = {
  queryResults?: {
    queryResultList?: {
      columns?: [ string ](name='Columns', description='The field names.'),
      values?: [ any ](name='Values', description='The resource data.'),
    }(name='QueryResultList', description='The queried resources. A maximum of 1,000 data records can be returned. To view more data, use the download URL of the resource file.'),
  }(name='QueryResults', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B0DBF868-460F-5E7C-8F76-1ACE2FCCE153'),
}

model ListAggregateResourcesByAdvancedSearchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregateResourcesByAdvancedSearchResponseBody(name='body'),
}

/**
 * @summary Obtains resources in a specific account group based on the fields in the resource properties by using a SELECT statement.
 *
 * @description When you write a `SELECT` statement, you must obtain the fields and the data types of the fields from the property file of the resource type. For more information about property files, see[ Alibaba Cloud Config Resource Schema](https://github.com/aliyun/alibabacloud-config-resource-schema)
 * > 
 * *   Each resource type supported by Cloud Config has a property file. Property files are named based on the related resource types. For example, the property file of the `ACS::ECS::Instance` resource type is named `ACS_ECS_Instance.properties.json`. Property files of different resource types are placed under the `config/properties/resource-types` path.
 * *   For more information about the examples and limits on SQL query statements, see [Examples of SQL query statements](https://help.aliyun.com/document_detail/398718.html) and [Limits on SQL query statements](https://help.aliyun.com/document_detail/398750.html).
 * This topic provides an example on how to obtain all resources whose tag key is `business` and whose tag value is `online` in the account group `ca-4b05626622af000c****` by using the advanced search feature.
 *
 * @param request ListAggregateResourcesByAdvancedSearchRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregateResourcesByAdvancedSearchResponse
 */
async function listAggregateResourcesByAdvancedSearchWithOptions(request: ListAggregateResourcesByAdvancedSearchRequest, runtime: Util.RuntimeOptions): ListAggregateResourcesByAdvancedSearchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.sql)) {
    query['Sql'] = request.sql;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregateResourcesByAdvancedSearch',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains resources in a specific account group based on the fields in the resource properties by using a SELECT statement.
 *
 * @description When you write a `SELECT` statement, you must obtain the fields and the data types of the fields from the property file of the resource type. For more information about property files, see[ Alibaba Cloud Config Resource Schema](https://github.com/aliyun/alibabacloud-config-resource-schema)
 * > 
 * *   Each resource type supported by Cloud Config has a property file. Property files are named based on the related resource types. For example, the property file of the `ACS::ECS::Instance` resource type is named `ACS_ECS_Instance.properties.json`. Property files of different resource types are placed under the `config/properties/resource-types` path.
 * *   For more information about the examples and limits on SQL query statements, see [Examples of SQL query statements](https://help.aliyun.com/document_detail/398718.html) and [Limits on SQL query statements](https://help.aliyun.com/document_detail/398750.html).
 * This topic provides an example on how to obtain all resources whose tag key is `business` and whose tag value is `online` in the account group `ca-4b05626622af000c****` by using the advanced search feature.
 *
 * @param request ListAggregateResourcesByAdvancedSearchRequest
 * @return ListAggregateResourcesByAdvancedSearchResponse
 */
async function listAggregateResourcesByAdvancedSearch(request: ListAggregateResourcesByAdvancedSearchRequest): ListAggregateResourcesByAdvancedSearchResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregateResourcesByAdvancedSearchWithOptions(request, runtime);
}

model ListAggregatorsRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return in a request. Valid values: 1 to 100.

This parameter is required.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of `NextToken`.', example='TGlzdFJlc291cmNlU2hhcmVzJjE1MTI2NjY4NzY5MTAzOTEmMiZORnI4NDhVeEtrUT0'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListAggregatorsShrinkRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return in a request. Valid values: 1 to 100.

This parameter is required.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of `NextToken`.', example='TGlzdFJlc291cmNlU2hhcmVzJjE1MTI2NjY4NzY5MTAzOTEmMiZORnI4NDhVeEtrUT0'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListAggregatorsResponseBody = {
  aggregatorsResult?: {
    aggregators?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the management account that is used to create the account group.', example='100931896542****'),
        aggregatorAccountCount?: long(name='AggregatorAccountCount', description='The number of member accounts in the account group.', example='2'),
        aggregatorCreateTimestamp?: long(name='AggregatorCreateTimestamp', description='The timestamp generated when the account group was created.', example='1623036305000'),
        aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-88ea626622af0055****'),
        aggregatorName?: string(name='AggregatorName', description='The name of the account group.', example='Test_Group'),
        aggregatorStatus?: int32(name='AggregatorStatus', description='The status of the account group. Valid values:

*   0: The account group is being created.
*   1: The account group was created.', example='1'),
        aggregatorType?: string(name='AggregatorType', description='The type of the account group. Valid values:

*   RD: global account group.
*   FOLDER: account group of the folder.
*   CUSTOM: custom account group.', example='CUSTOM'),
        description?: string(name='Description', description='The description of the account group.', example='Example-description'),
        folderId?: string(name='FolderId', description='The ID of the folder.', example='r-BU****'),
        tags?: [ 
          {
            tagKey?: string(name='TagKey', description='The tag keys of the resource.', example='key-1'),
            tagValue?: string(name='TagValue', description='The tag values of the resource.', example='value-1'),
          }
        ](name='Tags', description='tags'),
      }
    ](name='Aggregators', description='The list of the account groups.'),
    nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of `NextToken`.', example='TGlzdFJlc291cmNlU2hhcmVzJjE1MTI2NjY4NzY5MTAzOTEmMiZORnI4NDhVeEtrUT0'),
  }(name='AggregatorsResult', description='The account groups.'),
  requestId?: string(name='RequestId', description='The request ID.', example='20C8526D-12C5-4336-BC72-EBD5D1BA732F'),
}

model ListAggregatorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAggregatorsResponseBody(name='body'),
}

/**
 * @summary Queries all account groups within the current management account or delegated administrator account.
 *
 * @description The sample request in this topic shows you how to query account groups. A maximum of 10 entries can be returned for the request. As shown in the responses, the account group returned is named as `Test_Group`, its description is `Test account group`, and it is of the `CUSTOM` type, which indicates a custom account group. The account group contains two member accounts.
 *
 * @param tmpReq ListAggregatorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAggregatorsResponse
 */
async function listAggregatorsWithOptions(tmpReq: ListAggregatorsRequest, runtime: Util.RuntimeOptions): ListAggregatorsResponse {
  Util.validateModel(tmpReq);
  var request = new ListAggregatorsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAggregators',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries all account groups within the current management account or delegated administrator account.
 *
 * @description The sample request in this topic shows you how to query account groups. A maximum of 10 entries can be returned for the request. As shown in the responses, the account group returned is named as `Test_Group`, its description is `Test account group`, and it is of the `CUSTOM` type, which indicates a custom account group. The account group contains two member accounts.
 *
 * @param request ListAggregatorsRequest
 * @return ListAggregatorsResponse
 */
async function listAggregators(request: ListAggregatorsRequest): ListAggregatorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAggregatorsWithOptions(request, runtime);
}

model ListCompliancePackTemplatesRequest {
  compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template.', example='ct-d254ff4e06a300cf****'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 100. Minimum value: 1. Default value: 10.', example='10'),
  resourceTypes?: string(name='ResourceTypes', description='The types of the resources evaluated based on the rule. If you configure this parameter, only the rules that include the resource types in the compliance package template are returned.', example='ACS::ECS::Instance'),
}

model ListCompliancePackTemplatesResponseBody = {
  compliancePackTemplatesResult?: {
    compliancePackTemplates?: [ 
      {
        compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template.', example='ct-d254ff4e06a300cf****'),
        compliancePackTemplateName?: string(name='CompliancePackTemplateName', description='The name of the compliance package template.', example='BestPracticesForResourceStability'),
        configRules?: [ 
          {
            configRuleParameters?: [ 
              {
                parameterName?: string(name='ParameterName', description='The name of the input parameter of the managed rule.', example='days'),
                parameterValue?: string(name='ParameterValue', description='The value of the input parameter of the managed rule.', example='90'),
                required?: boolean(name='Required', description='Indicates whether the parameter is required in the managed rule. Valid values:

*   true: required
*   false: optional', example='true'),
              }
            ](name='ConfigRuleParameters', description='The input parameter of the managed rule.'),
            controlDescription?: string(name='ControlDescription', description='The description of the regulation. This parameter is available only for regulation compliance packages.', example='No classic networks exist.'),
            controlId?: string(name='ControlId', description='The regulation ID.

>  This parameter is available only for regulation compliance packages.', example='3.1'),
            defaultEnable?: boolean(name='DefaultEnable', description='Indicates whether the rules are enabled together with the compliance package. Valid values:

*   true
*   false', example='false'),
            description?: string(name='Description', description='The description of the rule.', example='If the expiration time of the SLB certificate is later than the specified number of days after the check time, the configuration is considered compliant. Default value: 90 days.'),
            managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The identifier of the managed rule.', example='slb-servercertificate-expired-check'),
            managedRuleName?: string(name='ManagedRuleName', description='The name of the managed rule.', example='slb-servercertificate-expired-check'),
            resourceTypesScope?: string(name='ResourceTypesScope', description='The types of the resources evaluated based on the rule.', example='ACS::SLB::ServerCertificate'),
            riskLevel?: int32(name='RiskLevel', description='The risk level of the managed rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
          }
        ](name='ConfigRules', description='The default rules in the compliance package.'),
        description?: string(name='Description', description='The description of the compliance package.', example='example-description'),
        labels?: string(name='Labels', description='The tag of the compliance package.', example='tagKey-1'),
        lastUpdate?: int32(name='LastUpdate', description='The time when the compliance package was last updated.', example='1663408308'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the managed rule in the compliance package. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
      }
    ](name='CompliancePackTemplates', description='The compliance package templates.'),
    pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
    totalCount?: long(name='TotalCount', description='The total number of the compliance package templates returned.', example='1'),
  }(name='CompliancePackTemplatesResult', description='The information about the compliance package templates returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D67FC82F-25AE-4268-A94C-3348340748F9'),
}

model ListCompliancePackTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCompliancePackTemplatesResponseBody(name='body'),
}

/**
 * @summary Queries all compliance package templates provided by Cloud Config and the details of the compliance package templates.
 *
 * @description A compliance package template is a collection of rules that Cloud Config can create based on compliance scenarios.
 *
 * @param request ListCompliancePackTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCompliancePackTemplatesResponse
 */
async function listCompliancePackTemplatesWithOptions(request: ListCompliancePackTemplatesRequest, runtime: Util.RuntimeOptions): ListCompliancePackTemplatesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compliancePackTemplateId)) {
    query['CompliancePackTemplateId'] = request.compliancePackTemplateId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCompliancePackTemplates',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries all compliance package templates provided by Cloud Config and the details of the compliance package templates.
 *
 * @description A compliance package template is a collection of rules that Cloud Config can create based on compliance scenarios.
 *
 * @param request ListCompliancePackTemplatesRequest
 * @return ListCompliancePackTemplatesResponse
 */
async function listCompliancePackTemplates(request: ListCompliancePackTemplatesRequest): ListCompliancePackTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCompliancePackTemplatesWithOptions(request, runtime);
}

model ListCompliancePacksRequest {
  pageNumber?: int32(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 100. Minimum value: 1. Default value: 10.', example='10'),
  status?: string(name='Status', description='The status of the compliance package to be queried. Valid values:

*   ACTIVE: The compliance package is active.
*   CREATING: The compliance package is being created.', example='ACTIVE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListCompliancePacksShrinkRequest {
  pageNumber?: int32(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 100. Minimum value: 1. Default value: 10.', example='10'),
  status?: string(name='Status', description='The status of the compliance package to be queried. Valid values:

*   ACTIVE: The compliance package is active.
*   CREATING: The compliance package is being created.', example='ACTIVE'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListCompliancePacksResponseBody = {
  compliancePacksResult?: {
    compliancePacks?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the compliance package belongs.', example='120886317861****'),
        compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='cp-fdc8626622af00f9****'),
        compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='ClassifiedProtectionPreCheck'),
        compliancePackTemplateId?: string(name='CompliancePackTemplateId', description='The ID of the compliance package template.', example='ct-5f26ff4e06a300c4****'),
        createTimestamp?: long(name='CreateTimestamp', description='The timestamp when the compliance package was created. Unit: milliseconds.', example='1621325046000'),
        description?: string(name='Description', description='The description of the compliance package.', example='Based on the Level 3 standards Equal Protection 2.0, this template provides continuous compliance monitoring recommendations to help you perform self-inspections and fix issues in advance, ensuring a quick pass during the official inspection.'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
        status?: string(name='Status', description='The status of the compliance package. Valid values:

*   ACTIVE: The compliance package is normal.
*   CREATING: The compliance package is being created.', example='ACTIVE'),
        tags?: [ 
          {
            tagKey?: string(name='TagKey', description='tag key', example='key-1'),
            tagValue?: string(name='TagValue', description='tag value', example='value-1'),
          }
        ](name='Tags', description='The tags.'),
      }
    ](name='CompliancePacks', description='The compliance packages.'),
    pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
    totalCount?: long(name='TotalCount', description='The total number of compliance packages returned.', example='1'),
  }(name='CompliancePacksResult', description='The compliance packages returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model ListCompliancePacksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCompliancePacksResponseBody(name='body'),
}

/**
 * @summary Queries a list of compliance packages.
 *
 * @description This topic provides an example of how to query compliance packages. The return result shows the details of the `cp-fdc8626622af00f9****` compliance package.
 *
 * @param tmpReq ListCompliancePacksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCompliancePacksResponse
 */
async function listCompliancePacksWithOptions(tmpReq: ListCompliancePacksRequest, runtime: Util.RuntimeOptions): ListCompliancePacksResponse {
  Util.validateModel(tmpReq);
  var request = new ListCompliancePacksShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCompliancePacks',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of compliance packages.
 *
 * @description This topic provides an example of how to query compliance packages. The return result shows the details of the `cp-fdc8626622af00f9****` compliance package.
 *
 * @param request ListCompliancePacksRequest
 * @return ListCompliancePacksResponse
 */
async function listCompliancePacks(request: ListCompliancePacksRequest): ListCompliancePacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCompliancePacksWithOptions(request, runtime);
}

model ListConfigDeliveryChannelsRequest {
  deliveryChannelIds?: string(name='DeliveryChannelIds', description='The ID of the delivery channel. Separate multiple IDs with commas (,).', example='cdc-d9106457e0d900b1****'),
}

model ListConfigDeliveryChannelsResponseBody = {
  deliveryChannels?: [ 
    {
      accountId?: long(name='AccountId', description='The ID of your Alibaba Cloud account.', example='120886317861****'),
      compliantSnapshot?: boolean(name='CompliantSnapshot', description='Indicates whether the specified destination receives scheduled compliant snapshots. Cloud Config delivers scheduled compliant snapshots at `04:00Z` and `16:00Z` to  Log Service every day. The time is displayed in UTC. Valid values:

*   true: The specified destination receives scheduled compliant snapshots.
*   false: The specified destination does not receive scheduled compliant snapshots.', example='false'),
      configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Indicates whether the specified destination receives resource change logs. If the value of this parameter is true, Cloud Config delivers the resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true: The specified destination receives resource change logs.
*   false: The specified destination does not receive resource change logs.', example='true'),
      configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Indicates whether the specified destination receives scheduled resource snapshots. Cloud Config delivers scheduled resource snapshots at `04:00Z` and `16:00Z` to OSS, MNS, or Log Service every day. The time is displayed in UTC. Valid values:

*   true: The specified destination receives scheduled resource snapshots.
*   false: The specified destination does not receive scheduled resource snapshots.', example='false'),
      deliveryChannelAssumeRoleArn?: string(name='DeliveryChannelAssumeRoleArn', description='The ARN of the role assumed by the delivery channel.', example='acs:ram::120886317861****:role/aliyunserviceroleforconfig'),
      deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that is attached to the delivery channel. This parameter is available when you deliver data of all types to MNS or deliver snapshots to Log Service.

*   If the value of the DeliveryChannelType parameter is MNS, take note of the following settings of the lowest risk level and resource types of the events to which you subscribed:

    *   The setting of the lowest risk level for the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

        The `value` field indicates the lowest risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

    *   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

        The `values` field indicates the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`

*   If you set the DeliveryChannelType parameter to SLS, the setting of the resource types of the snapshots to which you want to deliver is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the snapshots to which you want to deliver. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
      deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-d9106457e0d900b1****'),
      deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.', example='myDeliveryChannel'),
      deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The Alibaba Cloud Resource Name (ARN) of the delivery destination.

*   If the value of the DeliveryChannelType parameter is OSS, the value of this parameter is the ARN of the destination OSS bucket.
*   If the value of the DeliveryChannelType parameter is MNS, the value of this parameter is the ARN of the destination MNS topic.
*   If the value of the DeliveryChannelType parameter is SLS, the value of this parameter is the ARN of the destination Log Service Logstore.', example='acs:oss:cn-shanghai:120886317861****:new-bucket'),
      deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery channel. Valid values:

*   OSS: Object Storage Service (OSS)
*   MNS: Message Service (MNS)
*   SLS: Log Service', example='OSS'),
      deliverySnapshotTime?: string(name='DeliverySnapshotTime', description='The time when Cloud Config delivers scheduled resources snapshots every day.

Format: `HH:mmZ`. This time is displayed in UTC.', example='09:10Z'),
      description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
      nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Indicates whether the specified destination receives resource non-compliance events. If the value of this parameter is true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are evaluated as non-compliant. Valid values:

*   true: The specified destination receives resource non-compliance events.
*   false: The specified destination does not receive resource non-compliance events.', example='false'),
      oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
      status?: int32(name='Status', description='The status of the delivery channel. Valid values:

*   0: The delivery channel is disabled.
*   1: The delivery channel is enabled.', example='1'),
    }
  ](name='DeliveryChannels', description='The information about the delivery channels.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DC300244-FCE3-5061-8214-C27ECB668487'),
}

model ListConfigDeliveryChannelsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConfigDeliveryChannelsResponseBody(name='body'),
}

/**
 * @summary Queries a list of delivery channels.
 *
 * @param request ListConfigDeliveryChannelsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListConfigDeliveryChannelsResponse
 */
async function listConfigDeliveryChannelsWithOptions(request: ListConfigDeliveryChannelsRequest, runtime: Util.RuntimeOptions): ListConfigDeliveryChannelsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deliveryChannelIds)) {
    query['DeliveryChannelIds'] = request.deliveryChannelIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListConfigDeliveryChannels',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of delivery channels.
 *
 * @param request ListConfigDeliveryChannelsRequest
 * @return ListConfigDeliveryChannelsResponse
 */
async function listConfigDeliveryChannels(request: ListConfigDeliveryChannelsRequest): ListConfigDeliveryChannelsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConfigDeliveryChannelsWithOptions(request, runtime);
}

model ListConfigRuleEvaluationResultsRequest {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).', example='cp-f1e3326622af00cb****'),
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='NON_COMPLIANT', nullable=true),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

You can call the [ListConfigRules](https://help.aliyun.com/document_detail/169607.html) operation to obtain the rule ID.', example='cr-cac56457e0d900d3****'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return in a request. Valid values: 1 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of `NextToken`.', example='IWBjqMYSy0is7zSMGu16****'),
  regions?: string(name='Regions', description='The ID of the region where the resources that you want to evaluate reside. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  resourceGroupIds?: string(name='ResourceGroupIds', description='The ID of the resource group to which the resources that you want to evaluate belong. Separate multiple resource group IDs with commas (,).', example='rg-aek2indxn3g****'),
  resourceTypes?: string(name='ResourceTypes', description='The type of the resources that you want to evaluate. Separate multiple resource types with commas (,).', example='ACS::ECS::Instane'),
}

model ListConfigRuleEvaluationResultsResponseBody = {
  evaluationResults?: {
    evaluationResultList?: [ 
      {
        annotation?: string(name='Annotation', description='The annotation to the resource that is evaluated as non-compliant. The following section describe the parameters that can be returned:

*   `configuration`: the current resource configuration that is evaluated as non-compliant.
*   `desiredValue`: the expected resource configuration that is evaluated as compliant.
*   `operator`: the operator that compares the current configuration with the expected configuration of the resource.
*   `property`: the JSON path of the current configuration in the resource property struct.
*   `reason`: the reason why the resource is evaluated as non-compliant.', example='{\\\\"configuration\\\\":\\\\"\\\\",\\\\"desiredValue\\\\":\\\\"\\\\",\\\\"operator\\\\":\\\\"IsNotStringEmpty\\\\",\\\\"property\\\\":\\\\"$.KeyPairName\\\\",\\\\"reason\\\\":\\\\"No property contains.\\\\"}'),
        complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='NON_COMPLIANT'),
        configRuleInvokedTimestamp?: long(name='ConfigRuleInvokedTimestamp', description='The timestamp when the rule was triggered for the compliance evaluation. Unit: milliseconds.', example='1622802307081'),
        evaluationId?: string(name='EvaluationId', example='00000089-4e0d-58b5-a96a-8e54112110f3'),
        evaluationResultIdentifier?: {
          evaluationResultQualifier?: {
            compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package to which the rule belongs.', example='cp-bcc33457e0d900d5****'),
            configRuleArn?: string(name='ConfigRuleArn', description='The ARN of the rule.', example='acs:config::120886317861****:rule/cr-cac56457e0d900d3****'),
            configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-cac56457e0d900d3****'),
            configRuleName?: string(name='ConfigRuleName', description='The rule name.', example='test-rule-name'),
            ignoreDate?: string(name='IgnoreDate', description='The date on which the system automatically re-evaluates the ignored incompliant resources.

>  If the value of this parameter is left empty, the system does not automatically re-evaluate the ignored incompliant resources. You must manually re-evaluate the ignored incompliant resources.', example='2022-06-01'),
            regionId?: string(name='RegionId', description='The ID of the region in which your resources reside.', example='cn-hangzhou'),
            resourceId?: string(name='ResourceId', description='The resource ID.', example='i-hp3e4kvhzqn2s11t****'),
            resourceName?: string(name='ResourceName', description='The resource name.', example='iZuf6j91r34rnwawoox****'),
            resourceOwnerId?: long(name='ResourceOwnerId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='120886317861****'),
            resourceType?: string(name='ResourceType', description='The type of the resource that is monitored by Cloud Config.', example='ACS::ECS::Instance'),
          }(name='EvaluationResultQualifier', description='The information about the evaluated resource in the compliance evaluation result.'),
          orderingTimestamp?: long(name='OrderingTimestamp', description='The timestamp when the compliance evaluation was performed. Unit: milliseconds.', example='1622802307081'),
        }(name='EvaluationResultIdentifier', description='The identifying information about the compliance evaluation result.'),
        invokingEventMessageType?: string(name='InvokingEventMessageType', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.
*   Manual: The rule is manually triggered.', example='ConfigurationItemChangeNotification'),
        lastNonCompliantRecordTimestamp?: long(name='LastNonCompliantRecordTimestamp', example='1744696665000'),
        remediationEnabled?: boolean(name='RemediationEnabled', description='Indicates whether the remediation template is enabled. Valid values:

*   true: The remediation template is enabled.
*   false: The remediation template is disabled.', example='false'),
        resultRecordedTimestamp?: long(name='ResultRecordedTimestamp', description='The timestamp when the compliance evaluation result was recorded. Unit: milliseconds.', example='1622802307150'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
      }
    ](name='EvaluationResultList', description='The details of the compliance evaluation result.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned per page.', example='10'),
    nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='IWBjqMYSy0is7zSMGu16****'),
  }(name='EvaluationResults', description='The compliance evaluation results returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2A4A33BD-8186-4D60-91B9-42174EED75B5'),
}

model ListConfigRuleEvaluationResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConfigRuleEvaluationResultsResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation results of resources based on a rule.
 *
 * @description This topic provides an example on how to query the compliance evaluation result of resources based on a rule whose ID is `cr-cac56457e0d900d3****`. The returned result indicates that the `i-hp3e4kvhzqn2s11t****` resource is evaluated as `NON_COMPLIANT` by using the rule. The resource is an Elastic Compute Service (ECS) instance.
 *
 * @param request ListConfigRuleEvaluationResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListConfigRuleEvaluationResultsResponse
 */
async function listConfigRuleEvaluationResultsWithOptions(request: ListConfigRuleEvaluationResultsRequest, runtime: Util.RuntimeOptions): ListConfigRuleEvaluationResultsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListConfigRuleEvaluationResults',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation results of resources based on a rule.
 *
 * @description This topic provides an example on how to query the compliance evaluation result of resources based on a rule whose ID is `cr-cac56457e0d900d3****`. The returned result indicates that the `i-hp3e4kvhzqn2s11t****` resource is evaluated as `NON_COMPLIANT` by using the rule. The resource is an Elastic Compute Service (ECS) instance.
 *
 * @param request ListConfigRuleEvaluationResultsRequest
 * @return ListConfigRuleEvaluationResultsResponse
 */
async function listConfigRuleEvaluationResults(request: ListConfigRuleEvaluationResultsRequest): ListConfigRuleEvaluationResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConfigRuleEvaluationResultsWithOptions(request, runtime);
}

model ListConfigRuleEvaluationStatisticsResponseBody = {
  evaluationResults?: [ 
    {
      nonCompliantResourceCnt?: int32(name='NonCompliantResourceCnt', description='The number of resources that are evaluated as non-compliant.', example='30'),
      nonCompliantRuleCnt?: int32(name='NonCompliantRuleCnt', description='The number of rules based on which resources are evaluated as non-compliant.', example='5'),
      statisticDate?: string(name='StatisticDate', description='The date on which the statistics are obtained.', example='2023-06-27'),
      totalResourceCnt?: int32(name='TotalResourceCnt', description='The total number of resources.', example='91'),
      totalRuleCnt?: int32(name='TotalRuleCnt', description='The total number of rules.', example='13'),
    }
  ](name='EvaluationResults', description='The statistics of compliance evaluation results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4FF2B787-347E-5299-A196-2C0448DEA341'),
}

model ListConfigRuleEvaluationStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConfigRuleEvaluationStatisticsResponseBody(name='body'),
}

/**
 * @summary Queries the statistics of compliance evaluation results of the current Alibaba Cloud account.
 *
 * @param request ListConfigRuleEvaluationStatisticsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListConfigRuleEvaluationStatisticsResponse
 */
async function listConfigRuleEvaluationStatisticsWithOptions(runtime: Util.RuntimeOptions): ListConfigRuleEvaluationStatisticsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListConfigRuleEvaluationStatistics',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics of compliance evaluation results of the current Alibaba Cloud account.
 *
 * @return ListConfigRuleEvaluationStatisticsResponse
 */
async function listConfigRuleEvaluationStatistics(): ListConfigRuleEvaluationStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConfigRuleEvaluationStatisticsWithOptions(runtime);
}

model ListConfigRulesRequest {
  compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/606968.html).

>  You must configure either the `CompliancePackId` or `ConfigRuleId` parameter.', example='cp-fe416457e0d90022****'),
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the rule. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No resource data is available.', example='COMPLIANT'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='test-rule-name'),
  configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:

*   ACTIVE: The rule is enabled.
*   DELETING: The rule is being deleted.
*   EVALUATING: The rule is being used to evaluate resource configurations.
*   INACTIVE: The rule is disabled.', example='ACTIVE'),
  keyword?: string(name='Keyword', description='The query keyword.

You can perform a fuzzy search by rule ID, rule name, rule description, or managed rule ID.', example='ecs'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Page numbers start from 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 100. A minimum of 1 entry can be returned per page. Default value: 10.', example='10'),
  resourceTypes?: string(name='ResourceTypes', description='The type of the resources to be evaluated based on the rule.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.

You can specify at most 20 tag keys.', example='key-1'),
      value?: string(name='Value', description='The value of tag N to add to the resource. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The tag value must start with a letter but cannot start with `aliyun` or `acs:`. The tag value cannot contain `http://` or `https://`.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListConfigRulesShrinkRequest {
  compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/606968.html).

>  You must configure either the `CompliancePackId` or `ConfigRuleId` parameter.', example='cp-fe416457e0d90022****'),
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the rule. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No resource data is available.', example='COMPLIANT'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='test-rule-name'),
  configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:

*   ACTIVE: The rule is enabled.
*   DELETING: The rule is being deleted.
*   EVALUATING: The rule is being used to evaluate resource configurations.
*   INACTIVE: The rule is disabled.', example='ACTIVE'),
  keyword?: string(name='Keyword', description='The query keyword.

You can perform a fuzzy search by rule ID, rule name, rule description, or managed rule ID.', example='ecs'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Page numbers start from 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 100. A minimum of 1 entry can be returned per page. Default value: 10.', example='10'),
  resourceTypes?: string(name='ResourceTypes', description='The type of the resources to be evaluated based on the rule.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListConfigRulesResponseBody = {
  configRules?: {
    configRuleList?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the account to which the rule belongs.', example='100931896542****'),
        automationType?: string(name='AutomationType', description='The type of the remediation template. Only OOS is returned, which indicates CloudOps Orchestration Service.', example='OOS'),
        compliance?: {
          complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the rule. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No resource data is available.', example='COMPLIANT'),
          count?: int32(name='Count', description='The number of resources that are evaluated based on the rule.', example='2'),
        }(name='Compliance', description='The compliance aggregation result of the rule.'),
        configRuleArn?: string(name='ConfigRuleArn', description='The ARN of the rule.', example='acs:config::100931896542****:rule/cr-fdc8626622af00f9****'),
        configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-fdc8626622af00f9****'),
        configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='test-rule-name'),
        configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:

*   ACTIVE: The rule is enabled.
*   DELETING: The rule is being deleted.
*   EVALUATING: The rule is being used to evaluate resource configurations.
*   INACTIVE: The rule is disabled.', example='ACTIVE'),
        createBy?: {
          compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='cp-fdc8626622af00f9****'),
          compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='test-pack-name'),
        }(name='CreateBy', description='The information about the creation of the rule.'),
        description?: string(name='Description', description='The description of the rule.', example='The description of the test rule.'),
        resourceTypesScope?: string(name='ResourceTypesScope', description='The types of resources evaluated by the rule. Multiple resource types are separated with commas (,).', example='ACS::EIP::EipAddress'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high.
*   2: medium.
*   3: low.', example='1'),
        sourceIdentifier?: string(name='SourceIdentifier', description='The identifier of the rule.

*   If the rule is a managed rule, the value of this parameter is the identifier of the managed rule.
*   If the rule is a custom rule, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of the rule.', example='eip-bandwidth-limit'),
        sourceOwner?: string(name='SourceOwner', description='The type of the rule. Valid values:

*   CUSTOM_FC: a custom rule.
*   ALIYUN: a managed rule.', example='ALIYUN'),
        tags?: [ 
          {
            key?: string(name='Key', description='The tag key of the rule.', example='env'),
            value?: string(name='Value', description='The tag value of the rule.', example='prod'),
          }
        ](name='Tags', description='The tags of the rule.'),
      }
    ](name='ConfigRuleList', description='The details of the rule.'),
    pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
    totalCount?: long(name='TotalCount', description='The total number of rules.', example='1'),
  }(name='ConfigRules', description='The information about the rules.'),
  requestId?: string(name='RequestId', description='The request ID.', example='AC3A7E12-72E6-5CC9-A5C1-D8D8919829A7'),
}

model ListConfigRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConfigRulesResponseBody(name='body'),
}

/**
 * @summary Queries the rules of the current account.
 *
 * @description This topic provides an example on how to query the rules of the current account. The response shows that the current account has a total of one rule and three evaluated resources. The resources are evaluated as compliant.
 *
 * @param tmpReq ListConfigRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListConfigRulesResponse
 */
async function listConfigRulesWithOptions(tmpReq: ListConfigRulesRequest, runtime: Util.RuntimeOptions): ListConfigRulesResponse {
  Util.validateModel(tmpReq);
  var request = new ListConfigRulesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.complianceType)) {
    query['ComplianceType'] = request.complianceType;
  }
  if (!Util.isUnset(request.configRuleName)) {
    query['ConfigRuleName'] = request.configRuleName;
  }
  if (!Util.isUnset(request.configRuleState)) {
    query['ConfigRuleState'] = request.configRuleState;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  if (!Util.isUnset(request.riskLevel)) {
    query['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListConfigRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the rules of the current account.
 *
 * @description This topic provides an example on how to query the rules of the current account. The response shows that the current account has a total of one rule and three evaluated resources. The resources are evaluated as compliant.
 *
 * @param request ListConfigRulesRequest
 * @return ListConfigRulesResponse
 */
async function listConfigRules(request: ListConfigRulesRequest): ListConfigRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConfigRulesWithOptions(request, runtime);
}

model ListDiscoveredResourcesRequest {
  endUpdateTimestamp?: long(name='EndUpdateTimestamp', description='The end time of the time range for querying resources. The value is a timestamp in the UTC format. When you specify this parameter, take note of the following limits:

*   The value must be a timestamp in milliseconds.
*   The value cannot be less than the value of the StartUpdateTimestamp parameter. The interval between the value and the value of the StartUpdateTimestamp parameter must be less than or equal to 30 days.
*   The StartUpdateTimestamp and EndUpdateTimestamp parameters must be specified at the same time or left empty at the same time.', example='1724947200000'),
  excludeResourceTypes?: string(name='ExcludeResourceTypes', description='The types of resources that are excluded. Separate multiple values with commas (,). If this parameter conflicts with the ResourceTypes parameter, this parameter prevails.', example='ACS::ECS::Instance,ACS::ECS::NetworkInterface'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned for a single request. Valid values: 1 to 100.

This parameter is required.', example='10', nullable=true),
  nextToken?: string(name='NextToken', description='The `token` that you want to use to initiate the current request. If the response of the previous request is truncated, you can use this token to initiate another request and obtain the remaining entries.', example='IWBjqMYSy0is7zSMGu16****'),
  regions?: string(name='Regions', description='The ID of the region where the resource resides. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceDeleted?: int32(name='ResourceDeleted', description='The status of the resource. Valid values:

*   0: The resource is deleted. If a resource is deleted from the desired cloud service, **Deleted** is displayed in the resource list in the Cloud Config console.
*   1 (default): The resource is retained. If a resource is managed as expected, **Active** is displayed in the resource list in the Cloud Config console.', example='1'),
  resourceId?: string(name='ResourceId', description='The resource ID.', example='eni-hp31cqoba96jagtz****'),
  resourceTypes?: string(name='ResourceTypes', description='The type of the resource. Separate multiple resource types with commas (,).', example='ACS::ECS::NetworkInterface'),
  startUpdateTimestamp?: long(name='StartUpdateTimestamp', description='The start time of the time range for querying resources. The value is a timestamp in the UTC format. When you specify this parameter, take note of the following limits:

*   The value must be a timestamp in milliseconds.
*   The value cannot be greater than the value of the EndUpdateTimestamp parameter. The interval between the value and the value of the EndUpdateTimestamp parameter must be less than or equal to 30 days.
*   The StartUpdateTimestamp and EndUpdateTimestamp parameters must be specified at the same time or left blank at the same time.', example='1722441600000'),
}

model ListDiscoveredResourcesResponseBody = {
  discoveredResourceProfiles?: {
    discoveredResourceProfileList?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='161259599160****'),
        availabilityZone?: string(name='AvailabilityZone', description='The zone ID.', example='cn-hangzhou-h'),
        region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
        resourceCreationTime?: long(name='ResourceCreationTime', description='The timestamp when the resource was created. Unit: milliseconds.', example='1618675206000'),
        resourceDeleted?: int32(name='ResourceDeleted', description='The status of the resource. Valid values:

*   0: The resource is deleted.
*   1: The resource is retained.', example='1'),
        resourceId?: string(name='ResourceId', description='The resource ID.', example='eni-hp31cqoba96jagtz****'),
        resourceName?: string(name='ResourceName', description='The resource name.', example='Cloud Firewall'),
        resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The value of this parameter varies based on the resource type and may be empty. Examples:

*   If the ResourceType parameter is set to ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
*   If the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that is not in a specific state. In this case, this parameter is left empty.', example='InUse'),
        resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::NetworkInterface'),
        tags?: string(name='Tags', description='The tags of the resource.', example='{\\\\"key1\\\\":[\\\\"value2\\\\"]}'),
        updateTime?: long(name='UpdateTime', description='The time when the resource was last updated. The value must be a timestamp in milliseconds.', example='1722441600000'),
        version?: long(name='Version', description='The version of the resource change.', example='1'),
      }
    ](name='DiscoveredResourceProfileList', description='The details of the resources.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned on each page.', example='10'),
    nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='161259599160****'),
    totalCount?: int32(name='TotalCount', description='The total number of resources.', example='8'),
  }(name='DiscoveredResourceProfiles', description='The information about the resources.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}

model ListDiscoveredResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDiscoveredResourcesResponseBody(name='body'),
}

/**
 * @summary Obtains a list of resources aggregated across regions within an Alibaba Cloud account.
 *
 * @description This topic provides an example on how to call the ListDiscoveredResources operation to query the resources in the current Alibaba Cloud account. The returned result indicates that a total of eight resources exist in the account.
 *
 * @param request ListDiscoveredResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDiscoveredResourcesResponse
 */
async function listDiscoveredResourcesWithOptions(request: ListDiscoveredResourcesRequest, runtime: Util.RuntimeOptions): ListDiscoveredResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endUpdateTimestamp)) {
    query['EndUpdateTimestamp'] = request.endUpdateTimestamp;
  }
  if (!Util.isUnset(request.excludeResourceTypes)) {
    query['ExcludeResourceTypes'] = request.excludeResourceTypes;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regions)) {
    query['Regions'] = request.regions;
  }
  if (!Util.isUnset(request.resourceDeleted)) {
    query['ResourceDeleted'] = request.resourceDeleted;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  if (!Util.isUnset(request.startUpdateTimestamp)) {
    query['StartUpdateTimestamp'] = request.startUpdateTimestamp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDiscoveredResources',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains a list of resources aggregated across regions within an Alibaba Cloud account.
 *
 * @description This topic provides an example on how to call the ListDiscoveredResources operation to query the resources in the current Alibaba Cloud account. The returned result indicates that a total of eight resources exist in the account.
 *
 * @param request ListDiscoveredResourcesRequest
 * @return ListDiscoveredResourcesResponse
 */
async function listDiscoveredResources(request: ListDiscoveredResourcesRequest): ListDiscoveredResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDiscoveredResourcesWithOptions(request, runtime);
}

model ListIntegratedServiceResponseBody = {
  data?: [ 
    {
      aggregatorDeliveryDataType?: string(name='AggregatorDeliveryDataType', description='The type of the event that is integrated across accounts. Valid values:

*   NonCompliantNotification: non-compliance event', example='NonCompliantNotification'),
      integratedTypes?: string(name='IntegratedTypes', description='The types of the integrated events. Separate multiple event types with commas (,). Valid values:

*   ConfigurationItemChangeNotification: resource change event
*   NonCompliantNotification: non-compliance event', example='NonCompliantNotification'),
      serviceCode?: string(name='ServiceCode', description='The identifier of the cloud service. Valid values:

*   eventbridge: EventBridge
*   cms: CloudMonitor
*   bpstudio: Cloud Architect Design Tools', example='cms'),
      serviceName?: string(name='ServiceName', description='The name of the cloud service.', example='cms'),
      status?: boolean(name='Status', description='The integration status of the cloud service. Valid values:

*   true
*   false', example='true'),
    }
  ](name='Data', description='The information about the cloud service that can be integrated.'),
  requestId?: string(name='RequestId', description='The request ID.', example='86DB52A5-0C25-505A-96D5-9BAE1EFA00B9'),
}

model ListIntegratedServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntegratedServiceResponseBody(name='body'),
}

/**
 * @summary Queries a list of cloud services that are integrated with Cloud Config and the status of each cloud service.
 *
 * @description This topic provides an example on how to query the cloud services that can be integrated by the current Alibaba Cloud account.
 *
 * @param request ListIntegratedServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntegratedServiceResponse
 */
async function listIntegratedServiceWithOptions(runtime: Util.RuntimeOptions): ListIntegratedServiceResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListIntegratedService',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of cloud services that are integrated with Cloud Config and the status of each cloud service.
 *
 * @description This topic provides an example on how to query the cloud services that can be integrated by the current Alibaba Cloud account.
 *
 * @return ListIntegratedServiceResponse
 */
async function listIntegratedService(): ListIntegratedServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIntegratedServiceWithOptions(runtime);
}

model ListManagedRulesRequest {
  filterType?: string(name='FilterType', description='The scope for filtering managed rules allows you to filter out managed rules without resource coverage. The possible values are:

 - ALL: All rules.

 - UNCOVERED_RESOURCE: Filters managed rules where some resources are not covered.', example='ALL'),
  keyword?: string(name='Keyword', description='The keyword of the managed rule.', example='CDN'),
  pageNumber?: int32(name='PageNumber', description='The page number of the page to return.

Pages start from page 1. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 100. Minimum value: 1. Default value: 10.', example='10'),
  resourceTypes?: string(name='ResourceTypes', description='The type of the resources to be evaluated based on the rule.', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the managed rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
}

model ListManagedRulesResponseBody = {
  managedRules?: {
    managedRuleList?: [ 
      {
        configRuleName?: string(name='ConfigRuleName', description='The name of the managed rule.', example='test-rule-name'),
        description?: string(name='Description', description='The description of the managed rule.', example='The description of the test rule.'),
        helpUrls?: string(name='HelpUrls', description='The URL of the topic that describes how the managed rule remediates the incompliant configurations.', example='https://example.aliyundoc.com'),
        identifier?: string(name='Identifier', description='The unique identifier of the managed rule.', example='cdn-domain-https-enabled'),
        labels?: [ string ](name='Labels', description='The classification description of the managed rule.'),
        remediationTemplateIdentifier?: string(name='RemediationTemplateIdentifier', description='The ID of the remediation template.', example='ACS-CDN-SetDomainServerCertificate'),
        remediationTemplateName?: string(name='RemediationTemplateName', description='The name of the remediation template.', example='Configure encryption rules for OSS buckets'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='1'),
        scope?: {
          complianceResourceTypes?: [ string ](name='ComplianceResourceTypes', description='The types of resources to which the managed rule applies.'),
        }(name='Scope', description='The effective scope of the managed rule.'),
        supportPreviewManagedRule?: boolean(name='SupportPreviewManagedRule', description='Indicates whether precheck is supported. Valid values:

*   true
*   false', example='true'),
      }
    ](name='ManagedRuleList', description='The details of the managed rule.'),
    pageNumber?: int32(name='PageNumber', description='The page number.

Page start from page 1.', example='10'),
    pageSize?: int32(name='PageSize', description='The number of entries returned per page. Valid values: 1 to 500.', example='1'),
    totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
  }(name='ManagedRules', description='The managed rules.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B3E605AB-63D5-1EE0-BFA6-0BAC247B0461'),
}

model ListManagedRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListManagedRulesResponseBody(name='body'),
}

/**
 * @summary Queries a list of managed rules supported by Cloud Config.
 *
 * @description ### [](#)Background information
 * For more information about how to define, execute, and integrate a managed rule, see [Definition and execution of rules](https://help.aliyun.com/document_detail/128273.html).
 * ### [](#)Description
 * This topic provides an example on how to query all managed rules whose keyword is `CDN`. The response shows that 21 managed rules exist.
 *
 * @param request ListManagedRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListManagedRulesResponse
 */
async function listManagedRulesWithOptions(request: ListManagedRulesRequest, runtime: Util.RuntimeOptions): ListManagedRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.filterType)) {
    query['FilterType'] = request.filterType;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceTypes)) {
    query['ResourceTypes'] = request.resourceTypes;
  }
  if (!Util.isUnset(request.riskLevel)) {
    query['RiskLevel'] = request.riskLevel;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListManagedRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of managed rules supported by Cloud Config.
 *
 * @description ### [](#)Background information
 * For more information about how to define, execute, and integrate a managed rule, see [Definition and execution of rules](https://help.aliyun.com/document_detail/128273.html).
 * ### [](#)Description
 * This topic provides an example on how to query all managed rules whose keyword is `CDN`. The response shows that 21 managed rules exist.
 *
 * @param request ListManagedRulesRequest
 * @return ListManagedRulesResponse
 */
async function listManagedRules(request: ListManagedRulesRequest): ListManagedRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listManagedRulesWithOptions(request, runtime);
}

model ListPreManagedRulesRequest {
  pageNumber?: long(name='PageNumber', description='The number of the page to return.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page.

Default value: 10.', example='1'),
  resourceTypes?: [ string ](name='ResourceTypes', description='The type of the resource.'),
}

model ListPreManagedRulesShrinkRequest {
  pageNumber?: long(name='PageNumber', description='The number of the page to return.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page.

Default value: 10.', example='1'),
  resourceTypesShrink?: string(name='ResourceTypes', description='The type of the resource.'),
}

model ListPreManagedRulesResponseBody = {
  managedRules?: [ 
    {
      compulsoryInputParameterDetails?: map[string]any(name='CompulsoryInputParameterDetails', description='The details of the required input parameters of the rule.', example='{}'),
      configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='ram-user-ak-used-expired-check'),
      description?: string(name='Description', description='The description of the rule.', example='Example description'),
      helpUrls?: string(name='HelpUrls', description='The URL of the topic that describes how the evaluation rule remediates the incompliant configurations.', example='https://example.aliyundoc.com'),
      identifier?: string(name='Identifier', description='The identifier of the rule.', example='ecs-instance-deletion-protection-enabled'),
      optionalInputParameterDetails?: map[string]any(name='OptionalInputParameterDetails', description='The details of the optional input parameters of the rule.', example='{}'),
      resourceType?: string(name='ResourceType', description='The type of resource.', example='ACS::ECS::Instance'),
    }
  ](name='ManagedRules', description='The evaluation rules.'),
  pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A2A9F1BE-0712-1B26-9899-D82F7DA8476C'),
}

model ListPreManagedRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPreManagedRulesResponseBody(name='body'),
}

/**
 * @summary Queries a list of evaluation rules supported by Cloud Config.
 *
 * @description For more information about how to define, execute, and integrate an evaluation rule, see [Definition and execution of evaluation rules](https://help.aliyun.com/document_detail/470802.html).
 * After you create an evaluation rule, a managed rule that has the same settings as the evaluation rule is created. After you create a resource, the managed rule can be used to continuously check the compliance of the resource.
 *
 * @param tmpReq ListPreManagedRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPreManagedRulesResponse
 */
async function listPreManagedRulesWithOptions(tmpReq: ListPreManagedRulesRequest, runtime: Util.RuntimeOptions): ListPreManagedRulesResponse {
  Util.validateModel(tmpReq);
  var request = new ListPreManagedRulesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resourceTypes)) {
    request.resourceTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceTypes, 'ResourceTypes', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceTypesShrink)) {
    body['ResourceTypes'] = request.resourceTypesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListPreManagedRules',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of evaluation rules supported by Cloud Config.
 *
 * @description For more information about how to define, execute, and integrate an evaluation rule, see [Definition and execution of evaluation rules](https://help.aliyun.com/document_detail/470802.html).
 * After you create an evaluation rule, a managed rule that has the same settings as the evaluation rule is created. After you create a resource, the managed rule can be used to continuously check the compliance of the resource.
 *
 * @param request ListPreManagedRulesRequest
 * @return ListPreManagedRulesResponse
 */
async function listPreManagedRules(request: ListPreManagedRulesRequest): ListPreManagedRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPreManagedRulesWithOptions(request, runtime);
}

model ListRemediationExecutionsRequest {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

This parameter is required.', example='cr-5392626622af0000****'),
  executionStatus?: string(name='ExecutionStatus', description='The status of the remediation. Valid values:

*   Success
*   Failed', example='Success'),
  maxResults?: long(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 10 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='aVCjqNaSy0Ps7zSMGu25****'),
}

model ListRemediationExecutionsResponseBody = {
  remediationExecutionData?: {
    maxResults?: long(name='MaxResults', description='The maximum number of entries to return for a single request.', example='10'),
    nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='cMbjqNaYs0Ps7zSNiu37****'),
    remediationExecutions?: [ 
      {
        executionCreateDate?: string(name='ExecutionCreateDate', description='The time when the remediation record was created.', example='2023-06-25T11:48:15Z'),
        executionInvocationId?: string(name='ExecutionInvocationId', description='The invocation ID of the remediation record.', example='exec-befded3781994ccf****'),
        executionResourceIds?: string(name='ExecutionResourceIds', description='The IDs of the resources to which the remediation belongs. Separate multiple resource IDs with commas (,).', example='rm-0jlk629z240l8****'),
        executionResourceType?: string(name='ExecutionResourceType', description='The resource type.', example='ACS::RDS::DBInstance'),
        executionStatus?: string(name='ExecutionStatus', description='The status of the remediation record. Valid values:

*   Success
*   Failed', example='Success'),
        executionStatusMessage?: string(name='ExecutionStatusMessage', description='The error message returned when the remediation fails.', example='Invocation time out.'),
      }
    ](name='RemediationExecutions', description='The queried remediation records.'),
  }(name='RemediationExecutionData', description='The queried remediation records.'),
  requestId?: string(name='RequestId', description='The request ID.', example='13E67493-3165-529A-A961-BE9E4B11BA11'),
}

model ListRemediationExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRemediationExecutionsResponseBody(name='body'),
}

/**
 * @summary Queries the remediation records of a rule.
 *
 * @description This topic provides an example on how to query the remediation records of the rule cr-5392626622af0000\\*\\*\\*\\*.
 *
 * @param request ListRemediationExecutionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRemediationExecutionsResponse
 */
async function listRemediationExecutionsWithOptions(request: ListRemediationExecutionsRequest, runtime: Util.RuntimeOptions): ListRemediationExecutionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.executionStatus)) {
    query['ExecutionStatus'] = request.executionStatus;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRemediationExecutions',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the remediation records of a rule.
 *
 * @description This topic provides an example on how to query the remediation records of the rule cr-5392626622af0000\\*\\*\\*\\*.
 *
 * @param request ListRemediationExecutionsRequest
 * @return ListRemediationExecutionsResponse
 */
async function listRemediationExecutions(request: ListRemediationExecutionsRequest): ListRemediationExecutionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRemediationExecutionsWithOptions(request, runtime);
}

model ListRemediationTemplatesRequest {
  managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The identifier of the managed rule.

You can call the [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html) operation to obtain the managed rule identifier.', example='oss-bucket-public-write-prohibited', nullable=true),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: 1 to 100.', example='10'),
  remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid value: OOS, which stands for Operation Orchestration Service.', example='OOS'),
}

model ListRemediationTemplatesResponseBody = {
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: 1 to 100.', example='10'),
  remediationTemplates?: [ 
    {
      remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid value: OOS, which indicates Operation Orchestration Service.', example='OOS'),
      templateDefinition?: string(name='TemplateDefinition', description='The definition of the remediation template.', example='{
    "Parameters": {
        "bucketName": {
            "Default": "{resourceId}",
            "Description": {
                "zh-cn": "[Required]OSS Bucket Name.",
                "en": "[Required]OSS Bucket Name."
            },
            "Type": "String"
        },
        "regionId": {
            "AssociationProperty": "RegionId",
            "Default": "{regionId}",
            "Description": {
                "zh-cn": "[Required]The id of target region.",
                "en": "[Required]The id of target region."
            },
            "Type": "String"
        },
        "permissionName": {
            "AllowValues": "[\\\\"public-read-write\\\\",\\\\"public-read\\\\",\\\\"private\\\\"]",
            "Default": "private",
            "Description": {
                "zh-cn": "[Required]ACL Permission Name.",
                "en": "[Required]ACL Permission Name."
            },
            "Type": "String"
        }
    }
}'),
      templateDescription?: string(name='TemplateDescription', description='The description of the remediation template.', example='Configure encryption rules for OSSBucket through the PutBucketEncryption interface. Be aware of the risks and exercise caution.'),
      templateIdentifier?: string(name='TemplateIdentifier', description='The ID of the remediation template.', example='ACS-OSS-PutBucketAcl'),
      templateName?: string(name='TemplateName', description='The name of the remediation template.', example='Set the ACL of an OSS bucket to private'),
    }
  ](name='RemediationTemplates', description='The queried remediation templates.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FC2C4750-7024-499C-A69F-763543D1CBE3'),
  totalCount?: string(name='TotalCount', description='The total number of remediation templates.', example='1'),
}

model ListRemediationTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRemediationTemplatesResponseBody(name='body'),
}

/**
 * @summary Queries a list of remediation templates for a managed rule.
 *
 * @description In this topic, the `oss-bucket-public-write-prohibited` managed rule is used as an example. The return result shows the details of the remediation template of the `OOS` type for the managed rule. OOS represents Operation Orchestration Service.
 *
 * @param request ListRemediationTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRemediationTemplatesResponse
 */
async function listRemediationTemplatesWithOptions(request: ListRemediationTemplatesRequest, runtime: Util.RuntimeOptions): ListRemediationTemplatesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.managedRuleIdentifier)) {
    query['ManagedRuleIdentifier'] = request.managedRuleIdentifier;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.remediationType)) {
    query['RemediationType'] = request.remediationType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRemediationTemplates',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of remediation templates for a managed rule.
 *
 * @description In this topic, the `oss-bucket-public-write-prohibited` managed rule is used as an example. The return result shows the details of the remediation template of the `OOS` type for the managed rule. OOS represents Operation Orchestration Service.
 *
 * @param request ListRemediationTemplatesRequest
 * @return ListRemediationTemplatesResponse
 */
async function listRemediationTemplates(request: ListRemediationTemplatesRequest): ListRemediationTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRemediationTemplatesWithOptions(request, runtime);
}

model ListRemediationsRequest {
  configRuleIds?: string(name='ConfigRuleIds', description='The rule IDs. Separate multiple rule IDs with commas (,).

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).', example='cr-6b7c626622af00b4****'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: 1 to 50.', example='10'),
}

model ListRemediationsResponseBody = {
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1.

This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: 1 to 50.

This parameter is required.', example='10'),
  remediations?: [ 
    {
      accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
      configRuleId?: string(name='ConfigRuleId', description='The rule ID.', example='cr-6b7c626622af00b4****'),
      invokeType?: string(name='InvokeType', description='The execution mode of the remediation template. Valid values:

*   NON_EXECUTION: The remediation template was not executed.
*   AUTO_EXECUTION: The remediation template was automatically executed.
*   MANUAL_EXECUTION: The remediation template was manually executed.
*   NOT_CONFIG: The execution mode was not specified.', example='AUTO_EXECUTION'),
      lastSuccessfulInvocationId?: string(name='LastSuccessfulInvocationId', description='The ID of the last successful execution of the remediation template.', example='bd7629fb-cac8-42fe-bcb1-e362c5a6****'),
      lastSuccessfulInvocationTime?: long(name='LastSuccessfulInvocationTime', description='The timestamp of the last successful execution of the remediation template Unit: milliseconds.', example='1625451393589'),
      lastSuccessfulInvocationType?: string(name='LastSuccessfulInvocationType', description='The mode of the last successful execution of the remediation template. Valid values:

*   NON_EXECUTION: The remediation template was not executed.
*   AUTO_EXECUTION: The remediation template was automatically executed.
*   MANUAL_EXECUTION: The remediation template was manually executed.
*   NOT_CONFIG: The execution mode was not specified.', example='AUTO_EXECUTION'),
      remediationId?: string(name='RemediationId', description='The ID of the remediation template.', example='crr-6b7c626622af0026****'),
      remediationOriginParams?: string(name='RemediationOriginParams', description='The converted configuration of the remediation template. This parameter is available only for an OOS remediation template.', example='{"bucketName": "{resourceId}", "regionId": "{regionId}", "permissionName": "private"}'),
      remediationSourceType?: string(name='RemediationSourceType', description='The source of remediation. Valid values:

*   ALIYUN: official template.
*   CUSTOM: custom template.
*   NONE: none.', example='ALIYUN'),
      remediationTemplateId?: string(name='RemediationTemplateId', description='The ID of the remediation template.', example='ACS-OSS-PutBucketAcl'),
      remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid values:

*   OOS: Operation Orchestration Service (official remediation)
*   FC: Function Compute (custom remediation)', example='OOS'),
    }
  ](name='Remediations', description='The converted configuration of the remediation template. This parameter is returned only for an OOS remediation template.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0146963A-20C0-4E75-B93A-7D622B5FD7C8'),
  totalCount?: string(name='TotalCount', description='The total number of remediation settings.

This parameter is required.', example='1'),
}

model ListRemediationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRemediationsResponseBody(name='body'),
}

/**
 * @summary Queries the information about the execution of remediation templates.
 *
 * @description This topic provides an example on how to query the remediation templates for the rule whose ID is `cr-6b7c626622af00b4****`.
 *
 * @param request ListRemediationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRemediationsResponse
 */
async function listRemediationsWithOptions(request: ListRemediationsRequest, runtime: Util.RuntimeOptions): ListRemediationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configRuleIds)) {
    query['ConfigRuleIds'] = request.configRuleIds;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRemediations',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the execution of remediation templates.
 *
 * @description This topic provides an example on how to query the remediation templates for the rule whose ID is `cr-6b7c626622af00b4****`.
 *
 * @param request ListRemediationsRequest
 * @return ListRemediationsResponse
 */
async function listRemediations(request: ListRemediationsRequest): ListRemediationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRemediationsWithOptions(request, runtime);
}

model ListResourceEvaluationResultsRequest {
  complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:

*   COMPLIANT: The resource is evaluated as compliant.
*   NON_COMPLIANT: The resource is evaluated as non-compliant.
*   NOT_APPLICABLE: The rule does not apply to the resources.
*   INSUFFICIENT_DATA: No data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='NON_COMPLIANT'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return in a request. Valid values: 1 to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The token that you want to use to initiate the current request. If the response of the previous request is truncated, you can use this token to initiate another request and obtain the remaining entries.``', example='IWBjqMYSy0is7zSMGu16****'),
  region?: string(name='Region', description='The ID of the region where one or more resources you want to query reside. For example, the value `global` indicates global regions and the value `cn-hangzhou` indicates the China (Hangzhou) region.

For more information about how to obtain the ID of the region where a resource resides, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).', example='global'),
  resourceId?: string(name='ResourceId', description='The ID of the resource.

For more information about how to obtain the ID of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).', example='23642660635396****'),
  resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to query the type of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).', example='ACS::RAM::User'),
}

model ListResourceEvaluationResultsResponseBody = {
  evaluationResults?: {
    evaluationResultList?: [ 
      {
        annotation?: string(name='Annotation', description='The annotation to the resource that is evaluated as incompliant. The following section describes the parameters that can be returned:

*   `configuration`: the current resource configuration that is evaluated as incompliant by using the rule.
*   `desiredValue`: the expected resource configuration that is evaluated as compliant by using the rule.
*   `operator`: the operator that is used to compare the current configuration with the expected configuration of the resource.
*   `property`: the JSON path of the current configuration in the resource property struct.
*   `reason`: the reason why the resource is evaluated as incompliant.', example='{\\\\"configuration\\\\":\\\\"false\\\\",\\\\"desiredValue\\\\":\\\\"True\\\\",\\\\"operator\\\\":\\\\"StringEquals\\\\",\\\\"property\\\\":\\\\"$.LoginProfile.MFABindRequired\\\\"}'),
        complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resources. Valid values:

*   COMPLIANT: The resources are evaluated as compliant.
*   NON_COMPLIANT: The resources are evaluated as incompliant.
*   NOT_APPLICABLE: The rule does not apply to your resources.
*   INSUFFICIENT_DATA: No resource data is available.
*   IGNORED: The resource is ignored during compliance evaluation.', example='NON_COMPLIANT'),
        configRuleInvokedTimestamp?: long(name='ConfigRuleInvokedTimestamp', description='The timestamp when the rule was triggered for the compliance evaluation. Unit: milliseconds.', example='1624932227157'),
        evaluationId?: string(name='EvaluationId', example='00000089-4e0d-58b5-a96a-8e54112110f3'),
        evaluationResultIdentifier?: {
          evaluationResultQualifier?: {
            configRuleArn?: string(name='ConfigRuleArn', description='The Alibaba Cloud Resource Name (ARN) of the rule.', example='acs:config::100931896542****:rule/cr-7f7d626622af0041****'),
            configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-7f7d626622af0041****'),
            configRuleName?: string(name='ConfigRuleName', description='The name of the monitoring rule.', example='test-rule-name'),
            ignoreDate?: string(name='IgnoreDate', description='The date from which the system automatically re-evaluates the ignored incompliant resources.

>  If the value of this parameter is left empty, the system does not automatically re-evaluate the ignored incompliant resources. You must re-evaluate the ignored incompliant resources.', example='2022-06-01'),
            regionId?: string(name='RegionId', description='The ID of the region where your resources reside.', example='global'),
            resourceId?: string(name='ResourceId', description='The ID of the resource.', example='23642660635396****'),
            resourceName?: string(name='ResourceName', description='The name of the resource.', example='Alice'),
            resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::RAM::User'),
          }(name='EvaluationResultQualifier', description='The information about the evaluated resource returned in the compliance evaluation result.'),
          orderingTimestamp?: long(name='OrderingTimestamp', description='The timestamp when the compliance evaluation was performed. Unit: milliseconds.', example='1624932227157'),
        }(name='EvaluationResultIdentifier', description='The identifying information about the compliance evaluation result.'),
        invokingEventMessageType?: string(name='InvokingEventMessageType', description='The trigger type of the managed rule. Valid values:

*   ConfigurationItemChangeNotification: The managed rule is triggered by configuration changes.
*   ScheduledNotification: The managed rule is periodically triggered.
*   Manual: The rule is manually triggered.', example='ScheduledNotification'),
        lastNonCompliantRecordTimestamp?: long(name='LastNonCompliantRecordTimestamp', example='1744696393000'),
        remediationEnabled?: boolean(name='RemediationEnabled', description='Indicates whether the remediation template is enabled. Valid values:

- true: The remediation template is enabled.
- false: The remediation template is disabled.', example='true'),
        resultRecordedTimestamp?: long(name='ResultRecordedTimestamp', description='The timestamp when the compliance evaluation result was recorded. Unit: milliseconds.', example='1624932227595'),
        riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
      }
    ](name='EvaluationResultList', description='The details of the compliance evaluation result.'),
    maxResults?: int32(name='MaxResults', description='The maximum number of entries to return for a single request.', example='10'),
    nextToken?: string(name='NextToken', description='The token that was used to initiate the next request.', example='IWBjqMYSy0is7zSMGu16****'),
  }(name='EvaluationResults', description='The information about the compliance evaluation results returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25C89DDB-BB79-487D-88C3-4A561F21EFC4'),
}

model ListResourceEvaluationResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourceEvaluationResultsResponseBody(name='body'),
}

/**
 * @summary Queries the compliance evaluation results of resources.
 *
 * @description In this example, the compliance evaluation result of the `23642660635396****` resource is queried and the resource is a RAM user. The returned result indicates that the resource is evaluated as `NON_COMPLIANT` by using the `cr-7f7d626622af0041****` rule.
 *
 * @param request ListResourceEvaluationResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourceEvaluationResultsResponse
 */
async function listResourceEvaluationResultsWithOptions(request: ListResourceEvaluationResultsRequest, runtime: Util.RuntimeOptions): ListResourceEvaluationResultsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.complianceType)) {
    query['ComplianceType'] = request.complianceType;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListResourceEvaluationResults',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the compliance evaluation results of resources.
 *
 * @description In this example, the compliance evaluation result of the `23642660635396****` resource is queried and the resource is a RAM user. The returned result indicates that the resource is evaluated as `NON_COMPLIANT` by using the `cr-7f7d626622af0041****` rule.
 *
 * @param request ListResourceEvaluationResultsRequest
 * @return ListResourceEvaluationResultsResponse
 */
async function listResourceEvaluationResults(request: ListResourceEvaluationResultsRequest): ListResourceEvaluationResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listResourceEvaluationResultsWithOptions(request, runtime);
}

model ListResourceRelationsRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return in a request. Valid values: 1 to 1000.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='C2DjqMYSy0is7zSMGf21****'),
  region?: string(name='Region', description='The ID of the region in which the resource resides.

This parameter is required.', example='cn-shanghai'),
  relationType?: string(name='RelationType', description='The type of the relationship between the resource and the object.

Valid values:

*   IsContained: The object is included as part of the resource.
*   IsAttachedTo: The object is added to the resource.
*   IsAssociatedIn: The object is associated with the resource.
*   Contains: The object contains the resource.', example='IsAttachedTo'),
  resourceId?: string(name='ResourceId', description='The resource ID.

This parameter is required.', example='i-j6cajg9yrfoh4sas****'),
  resourceType?: string(name='ResourceType', description='The type of the resource.

This parameter is required.', example='ACS::ECS::Instance'),
  targetResourceId?: string(name='TargetResourceId', description='The ID of the resource that is associated with the object.', example='d-j6c8k731qbrc7fxi****'),
  targetResourceType?: string(name='TargetResourceType', description='The type of the resource that is associated with the object.', example='ACS::ECS::Disk'),
}

model ListResourceRelationsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6525F8DE-5A8B-5AD3-A241-BBF5A259E5B2'),
  resourceRelations?: {
    maxResults?: int32(name='MaxResults', description='The maximum number of entries returned on each page.', example='10'),
    nextToken?: string(name='NextToken', description='The token that was used to initiate the next request.', example='C2DjqMYSy0is7zSMGf21****'),
    resourceRelationList?: [ 
      {
        accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
        relationType?: string(name='RelationType', description='The type of the relationship between the resource and the object.

Valid values:

*   IsContained: The object is included as part of the resource.
*   IsAttachedTo: The object is added to the resource.
*   IsAssociatedIn: The object is associated with the resource.
*   Contains: The object contains the resource.', example='IsAttachedTo'),
        sourceResourceId?: string(name='SourceResourceId', description='The resource ID.', example='i-j6cajg9yrfoh4sas****'),
        sourceResourceRegionId?: string(name='SourceResourceRegionId', description='The ID of the region in which the resource resides.', example='cn-shanghai'),
        sourceResourceType?: string(name='SourceResourceType', description='The type of the resource.', example='ACS::ECS::Instance'),
        targetResourceId?: string(name='TargetResourceId', description='The ID of the associated resource.', example='d-j6c8k731qbrc7fxi****'),
        targetResourceType?: string(name='TargetResourceType', description='The type of the associated resource.', example='ACS::ECS::Disk'),
      }
    ](name='ResourceRelationList', description='An array that contains the relationships.'),
  }(name='ResourceRelations', description='The result of the relationship.'),
}

model ListResourceRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourceRelationsResponseBody(name='body'),
}

/**
 * @summary Queries a list of resources that associate with a specific resource.
 *
 * @description For information about the Alibaba Cloud services and resource types supported by Cloud Config, see [Alibaba Cloud services and resource types supported by Cloud Config](https://help.aliyun.com/document_detail/127411.html).
 * This topic provides an example on how to query the information about the disks that are attached to an Elastic Compute Service (ECS) instance named `i-j6cajg9yrfoh4sas****` that is created by the current Alibaba Cloud account in the China (Shanghai) region.
 *
 * @param request ListResourceRelationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourceRelationsResponse
 */
async function listResourceRelationsWithOptions(request: ListResourceRelationsRequest, runtime: Util.RuntimeOptions): ListResourceRelationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.relationType)) {
    query['RelationType'] = request.relationType;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.targetResourceId)) {
    query['TargetResourceId'] = request.targetResourceId;
  }
  if (!Util.isUnset(request.targetResourceType)) {
    query['TargetResourceType'] = request.targetResourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListResourceRelations',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of resources that associate with a specific resource.
 *
 * @description For information about the Alibaba Cloud services and resource types supported by Cloud Config, see [Alibaba Cloud services and resource types supported by Cloud Config](https://help.aliyun.com/document_detail/127411.html).
 * This topic provides an example on how to query the information about the disks that are attached to an Elastic Compute Service (ECS) instance named `i-j6cajg9yrfoh4sas****` that is created by the current Alibaba Cloud account in the China (Shanghai) region.
 *
 * @param request ListResourceRelationsRequest
 * @return ListResourceRelationsResponse
 */
async function listResourceRelations(request: ListResourceRelationsRequest): ListResourceRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listResourceRelationsWithOptions(request, runtime);
}

model ListResourcesByAdvancedSearchRequest {
  sql?: string(name='Sql', description='The SQL query statement.

This parameter is required.', example='SELECT ResourceId, ResourceName WHERE Tags.Kvpair=\\\\"business:online\\\\"'),
}

model ListResourcesByAdvancedSearchResponseBody = {
  queryResults?: {
    queryResultList?: {
      columns?: [ string ](name='Columns', description='The field names.'),
      values?: [ any ](name='Values', description='The resource data.'),
    }(name='QueryResultList', description='The queried resources. A maximum of 1,000 data records can be returned. To view more data, use the download URL of the resource file.'),
  }(name='QueryResults', description='The query result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D241DEBF-67A2-56AF-88CF-57BF78F0A850'),
}

model ListResourcesByAdvancedSearchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourcesByAdvancedSearchResponseBody(name='body'),
}

/**
 * @summary Obtains resources based on the fields in the resource properties by using a SELECT statement.
 *
 * @description When you write a `SELECT` statement, you must obtain the fields and the data types of the fields from the property file of the resource type. For more information about property files, see [Alibaba Cloud Config Resource Schema](https://github.com/aliyun/alibabacloud-config-resource-schema).
 * > 
 * *   Each resource type supported by Cloud Config has a property file. Property files are named based on the related resource types. For example, the property file of the `ACS::ECS::Instance` resource type is named `ACS_ECS_Instance.properties.json`. Property files of different resource types are placed under the `config/properties/resource-types` path.
 * *   For more information about the examples and limits on SQL query statements, see [Examples of SQL query statements](https://help.aliyun.com/document_detail/398718.html) and [Limits on SQL query statements](https://help.aliyun.com/document_detail/398750.html).
 * This topic provides an example on how to obtain all resources whose tag key is `business` and whose tag value is `online` within the current account by using the advanced search feature.
 *
 * @param request ListResourcesByAdvancedSearchRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourcesByAdvancedSearchResponse
 */
async function listResourcesByAdvancedSearchWithOptions(request: ListResourcesByAdvancedSearchRequest, runtime: Util.RuntimeOptions): ListResourcesByAdvancedSearchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sql)) {
    query['Sql'] = request.sql;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListResourcesByAdvancedSearch',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains resources based on the fields in the resource properties by using a SELECT statement.
 *
 * @description When you write a `SELECT` statement, you must obtain the fields and the data types of the fields from the property file of the resource type. For more information about property files, see [Alibaba Cloud Config Resource Schema](https://github.com/aliyun/alibabacloud-config-resource-schema).
 * > 
 * *   Each resource type supported by Cloud Config has a property file. Property files are named based on the related resource types. For example, the property file of the `ACS::ECS::Instance` resource type is named `ACS_ECS_Instance.properties.json`. Property files of different resource types are placed under the `config/properties/resource-types` path.
 * *   For more information about the examples and limits on SQL query statements, see [Examples of SQL query statements](https://help.aliyun.com/document_detail/398718.html) and [Limits on SQL query statements](https://help.aliyun.com/document_detail/398750.html).
 * This topic provides an example on how to obtain all resources whose tag key is `business` and whose tag value is `online` within the current account by using the advanced search feature.
 *
 * @param request ListResourcesByAdvancedSearchRequest
 * @return ListResourcesByAdvancedSearchResponse
 */
async function listResourcesByAdvancedSearch(request: ListResourcesByAdvancedSearchRequest): ListResourcesByAdvancedSearchResponse {
  var runtime = new Util.RuntimeOptions{};
  return listResourcesByAdvancedSearchWithOptions(request, runtime);
}

model ListSupportedProductsRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return in a request.

Valid values: 1 to 500. Default value: 200.', example='100'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='D3AjqMNSy0ls7zBNCf3a****'),
}

model ListSupportedProductsResponseBody = {
  maxResults?: string(name='MaxResults', description='The maximum number of entries to return for a single request. Valid values: 1 to 500.', example='100'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='D3AjqMNSy0ls7zBNCf3a****'),
  products?: [ 
    {
      productNameEn?: string(name='ProductNameEn', description='The English name of the Alibaba Cloud service.', example='Elastic Compute Service'),
      productNameZh?: string(name='ProductNameZh', description='The Chinese name of the Alibaba Cloud service.', example='云服务器ECS'),
      resourceTypeList?: [ 
        {
          resourceType?: string(name='ResourceType', description='The identifier of the resource type.', example='ACS::ECS::Instance'),
          typeNameEn?: string(name='TypeNameEn', description='The English name of the resource type.', example='Ecs Instance'),
          typeNameZh?: string(name='TypeNameZh', description='The Chinese name of the resource type.', example='ECS实例'),
          typePageLink?: string(name='TypePageLink', description='The URL of the resource type in the console.', example='https://ecs.console.aliyun.com/#/server/@{ResourceId}/detail?regionId=@{RegionId}'),
        }
      ](name='ResourceTypeList', description='The resource types that are supported by Cloud Config.'),
    }
  ](name='Products', description='The cloud services that are supported by Cloud Config.'),
  requestId?: string(name='RequestId', description='The request ID.', example='610B0276-ABEE-57DF-9C13-C2324FADA9D7'),
}

model ListSupportedProductsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSupportedProductsResponseBody(name='body'),
}

/**
 * @summary Queries the cloud services and resource types that are supported by Cloud Config.
 *
 * @description This topic provides an example on how to query the Alibaba Cloud services and resource types supported by a Cloud Config.
 *
 * @param request ListSupportedProductsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSupportedProductsResponse
 */
async function listSupportedProductsWithOptions(request: ListSupportedProductsRequest, runtime: Util.RuntimeOptions): ListSupportedProductsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSupportedProducts',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the cloud services and resource types that are supported by Cloud Config.
 *
 * @description This topic provides an example on how to query the Alibaba Cloud services and resource types supported by a Cloud Config.
 *
 * @param request ListSupportedProductsRequest
 * @return ListSupportedProductsResponse
 */
async function listSupportedProducts(request: ListSupportedProductsRequest): ListSupportedProductsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSupportedProductsWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJ****'),
  regionId?: string(name='RegionId', description='The region ID of the tag.

This parameter is required.', example='cn-shanghai'),
  resourceId?: [ string ](name='ResourceId', description='The resource ID.

You can add tags to up to 50 resources.'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   `ACS::Config::Rule`
*   `ACS::Config::AggregateConfigRule`
*   `ACS::Config::Aggregator`
*   `ACS::Config::CompliancePack`
*   `ACS::Config::AggregateCompliancePack`

This parameter is required.', example='ACS::Config:rule'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag that is added to the resource.

You can add up to 20 tag keys to a resource.', example='Env'),
      value?: string(name='Value', description='The value of the tag that is added to the resource.

You can add up to 20 tag values to a resource.', example='prod'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListTagResourcesShrinkRequest {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJ****'),
  regionId?: string(name='RegionId', description='The region ID of the tag.

This parameter is required.', example='cn-shanghai'),
  resourceId?: [ string ](name='ResourceId', description='The resource ID.

You can add tags to up to 50 resources.'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   `ACS::Config::Rule`
*   `ACS::Config::AggregateConfigRule`
*   `ACS::Config::Aggregator`
*   `ACS::Config::CompliancePack`
*   `ACS::Config::AggregateCompliancePack`

This parameter is required.', example='ACS::Config:rule'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.

> If NextToken is empty, no next page exists.', example='MTRBMDc0NjAtRUJFNy00N0NBLTk3NTctMTJ****'),
  requestId?: string(name='RequestId', description='The request ID.', example='AB2E4317-06A6-5745-B7C3-E001E551****'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The resource ID.', example='cr-115b626622af0060****'),
      resourceType?: string(name='ResourceType', description='The resource type.', example='ACS::Config:rule'),
      tagKey?: string(name='TagKey', description='The tag key.', example='Env'),
      tagValue?: string(name='TagValue', description='The tag value.', example='prod'),
    }
  ](name='TagResource')
  }(name='TagResources', description='The tags of the resource.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries tags that are added to specified resources.
 *
 * @param tmpReq ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(tmpReq: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(tmpReq);
  var request = new ListTagResourcesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagShrink)) {
    body['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries tags that are added to specified resources.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model PutEvaluationsRequest {
  deleteMode?: boolean(name='DeleteMode', description='Specifies whether to enable the delete mode. Valid values:

*   true: enables the delete mode
*   false (default): disables the delete mode

> This parameter is valid only when you manually trigger or periodically trigger custom rules to evaluate resources. If you enable the delete mode, the evaluation results that are not updated during the current evaluation are automatically deleted.', example='false'),
  evaluations?: string(name='Evaluations', description='The evaluation results.', example='[{"accountId":120886317861****,"annotation":"The flow log is not enabled.","complianceResourceId":"flowlog-o6wdfo1yvgo4i8****","complianceResourceType":"ACS::CEN::Flowlog","complianceRegionId":"cn-shanghai","complianceType":"NON_COMPLIANT","orderingTimestamp":1588907220408}]'),
  resultToken?: string(name='ResultToken', description='The callback token. When Cloud Config triggers a custom rule to evaluate resources, the token information is sent to Function Compute as an input parameter. The token must be specified when you submit the evaluation results.

This parameter is required.', example='=lAUbfkWp7GL9AFoQEIStinqBMc4FC8sHvip/1F1npkWUDNS2GEm6xwL6Zl/fSr0bbkWY+aiCLjTJxnp4H/yp/8p/Q8VCAtqG5uhRii4sfnYRnTPnE****'),
}

model PutEvaluationsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EDB324E2-A202-5FE4-A9BC-31E2C34F78A4'),
  result?: boolean(name='Result', description='Indicates whether the evaluation results of the custom rule are submitted. Valid values:

*   true: The evaluation results are submitted.
*   false: The evaluation results fail to be submitted.', example='true'),
}

model PutEvaluationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutEvaluationsResponseBody(name='body'),
}

/**
 * @summary Submits the evaluation results of a rule from Function Compute.
 *
 * @description For more information about the definition, use scenarios, and execution of custom function rules, see [Definition and execution of custom function rules](https://help.aliyun.com/document_detail/127405.html).
 *
 * @param request PutEvaluationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutEvaluationsResponse
 */
async function putEvaluationsWithOptions(request: PutEvaluationsRequest, runtime: Util.RuntimeOptions): PutEvaluationsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.deleteMode)) {
    body['DeleteMode'] = request.deleteMode;
  }
  if (!Util.isUnset(request.evaluations)) {
    body['Evaluations'] = request.evaluations;
  }
  if (!Util.isUnset(request.resultToken)) {
    body['ResultToken'] = request.resultToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PutEvaluations',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits the evaluation results of a rule from Function Compute.
 *
 * @description For more information about the definition, use scenarios, and execution of custom function rules, see [Definition and execution of custom function rules](https://help.aliyun.com/document_detail/127405.html).
 *
 * @param request PutEvaluationsRequest
 * @return PutEvaluationsResponse
 */
async function putEvaluations(request: PutEvaluationsRequest): PutEvaluationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return putEvaluationsWithOptions(request, runtime);
}

model RevertAggregateEvaluationResultsRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-5b6c626622af008f****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule in the account group.

This parameter is required.', example='cr-7e72626622af0051****'),
  resources?: [ 
    {
      region?: string(name='Region', description='The ID of the region in which your resources reside.

For more information about how to obtain the ID of the region in which your resources reside, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='cn-beijing'),
      resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.

>  You must specify the ID of the current management account or a member in the account group of the management account.

This parameter is required.', example='120886317861****'),
      resourceId?: string(name='ResourceId', description='The resource ID.

For more information about how to obtain the ID of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='lb-hp3a3b4ztyfm2plgm****'),
      resourceType?: string(name='ResourceType', description='The type of the resource.

For more information about how to obtain the type of a resource, see [ListAggregateDiscoveredResources](https://help.aliyun.com/document_detail/265983.html).

This parameter is required.', example='ACS::SLB::LoadBalancer'),
    }
  ](name='Resources', description='The resources that you want to re-evaluate.

This parameter is required.'),
}

model RevertAggregateEvaluationResultsShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-5b6c626622af008f****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule in the account group.

This parameter is required.', example='cr-7e72626622af0051****'),
  resourcesShrink?: string(name='Resources', description='The resources that you want to re-evaluate.

This parameter is required.'),
}

model RevertAggregateEvaluationResultsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='BB11CBF2-0B0B-59F2-9E84-07B38267AD12'),
}

model RevertAggregateEvaluationResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RevertAggregateEvaluationResultsResponseBody(name='body'),
}

/**
 * @summary Re-evaluates resources that are evaluated based on a rule after the evaluation results on some resources of an ignored rule in an account group are resumed.
 *
 * @description ### [](#)Prerequisites
 * One or more non-compliant resources that are evaluated by a rule are ignored. For more information, see [IgnoreAggregateEvaluationResults](https://help.aliyun.com/document_detail/607054.html).
 * ### [](#)Description
 * This topic provides an example on how to re-evaluate the non-compliant resource that is evaluated by the `cr-7e72626622af0051****` rule of the `120886317861****` member in the `ca-5b6c626622af008f****` group account. The ID of the region in which the resource resides is `cn-beijing`, the type of the resource is `ACS::SLB::LoadBalancer`, and the ID of the resource is `lb-hp3a3b4ztyfm2plgm****`.
 *
 * @param tmpReq RevertAggregateEvaluationResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RevertAggregateEvaluationResultsResponse
 */
async function revertAggregateEvaluationResultsWithOptions(tmpReq: RevertAggregateEvaluationResultsRequest, runtime: Util.RuntimeOptions): RevertAggregateEvaluationResultsResponse {
  Util.validateModel(tmpReq);
  var request = new RevertAggregateEvaluationResultsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resources)) {
    request.resourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resources, 'Resources', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleId)) {
    body['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.resourcesShrink)) {
    body['Resources'] = request.resourcesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RevertAggregateEvaluationResults',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Re-evaluates resources that are evaluated based on a rule after the evaluation results on some resources of an ignored rule in an account group are resumed.
 *
 * @description ### [](#)Prerequisites
 * One or more non-compliant resources that are evaluated by a rule are ignored. For more information, see [IgnoreAggregateEvaluationResults](https://help.aliyun.com/document_detail/607054.html).
 * ### [](#)Description
 * This topic provides an example on how to re-evaluate the non-compliant resource that is evaluated by the `cr-7e72626622af0051****` rule of the `120886317861****` member in the `ca-5b6c626622af008f****` group account. The ID of the region in which the resource resides is `cn-beijing`, the type of the resource is `ACS::SLB::LoadBalancer`, and the ID of the resource is `lb-hp3a3b4ztyfm2plgm****`.
 *
 * @param request RevertAggregateEvaluationResultsRequest
 * @return RevertAggregateEvaluationResultsResponse
 */
async function revertAggregateEvaluationResults(request: RevertAggregateEvaluationResultsRequest): RevertAggregateEvaluationResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return revertAggregateEvaluationResultsWithOptions(request, runtime);
}

model RevertEvaluationResultsRequest {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-7e72626622af0051****'),
  resources?: [ 
    {
      region?: string(name='Region', description='The ID of the region in which the resource resides.

For more information about how to obtain the ID of the region in which a resource resides, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='cn-beijing'),
      resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.

This parameter is required.', example='100931896542****'),
      resourceId?: string(name='ResourceId', description='The resource ID.

For more information about how to obtain the ID of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='lb-hp3a3b4ztyfm2plgm****'),
      resourceType?: string(name='ResourceType', description='The resource type.

For more information about how to query the type of a resource, see [ListDiscoveredResources](https://help.aliyun.com/document_detail/169620.html).

This parameter is required.', example='ACS::SLB::LoadBalancer'),
    }
  ](name='Resources', description='The resources that are to be re-evaluated.

This parameter is required.'),
}

model RevertEvaluationResultsShrinkRequest {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-7e72626622af0051****'),
  resourcesShrink?: string(name='Resources', description='The resources that are to be re-evaluated.

This parameter is required.'),
}

model RevertEvaluationResultsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='01ACCBF2-0B0B-59F2-9E84-07B38267BCA1'),
}

model RevertEvaluationResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RevertEvaluationResultsResponseBody(name='body'),
}

/**
 * @summary Re-evaluates resources that are evaluated based on a rule after the evaluation results on some resources of an ignored rule are resumed.
 *
 * @description ### [](#)Prerequisites
 * One or more non-compliant resources that are evaluated by a rule are ignored. For more information, see [IgnoreEvaluationResults](https://help.aliyun.com/document_detail/606990.html).
 * ### [](#)Description
 * This topic provides an example on how to re-evaluate the `lb-hp3a3b4ztyfm2plgm****` non-compliant resource that is evaluated by the `cr-7e72626622af0051****` rule. The ID of the region in which the resource resides is`cn-beijing`, the type of the resource is `ACS::SLB::LoadBalancer`, and the ID of the resource is `lb-hp3a3b4ztyfm2plgm****`.
 *
 * @param tmpReq RevertEvaluationResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RevertEvaluationResultsResponse
 */
async function revertEvaluationResultsWithOptions(tmpReq: RevertEvaluationResultsRequest, runtime: Util.RuntimeOptions): RevertEvaluationResultsResponse {
  Util.validateModel(tmpReq);
  var request = new RevertEvaluationResultsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resources)) {
    request.resourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resources, 'Resources', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.configRuleId)) {
    body['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.resourcesShrink)) {
    body['Resources'] = request.resourcesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RevertEvaluationResults',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Re-evaluates resources that are evaluated based on a rule after the evaluation results on some resources of an ignored rule are resumed.
 *
 * @description ### [](#)Prerequisites
 * One or more non-compliant resources that are evaluated by a rule are ignored. For more information, see [IgnoreEvaluationResults](https://help.aliyun.com/document_detail/606990.html).
 * ### [](#)Description
 * This topic provides an example on how to re-evaluate the `lb-hp3a3b4ztyfm2plgm****` non-compliant resource that is evaluated by the `cr-7e72626622af0051****` rule. The ID of the region in which the resource resides is`cn-beijing`, the type of the resource is `ACS::SLB::LoadBalancer`, and the ID of the resource is `lb-hp3a3b4ztyfm2plgm****`.
 *
 * @param request RevertEvaluationResultsRequest
 * @return RevertEvaluationResultsResponse
 */
async function revertEvaluationResults(request: RevertEvaluationResultsRequest): RevertEvaluationResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return revertEvaluationResultsWithOptions(request, runtime);
}

model StartAggregateConfigRuleEvaluationRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-3a58626622af0005****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

> You must configure either the `CompliancePackId` or `ConfigRuleId` parameter.', example='cp-ac16626622af0053****'),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to query the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

>  You must configure either the `CompliancePackId` or `ConfigRuleId` parameter.', example='cr-c169626622af009f****'),
  revertEvaluation?: boolean(name='RevertEvaluation', description='Specifies whether to re-evaluate the ignored non-compliant resource. Valid values:

*   true: re-evaluates the ignored non-compliant resource based on the rule.
*   false (default): does not re-evaluate the ignored non-compliant resource based on the rule.', example='false'),
}

model StartAggregateConfigRuleEvaluationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='ABC0FFF8-0B44-40C6-8BBF-3A185EFDD212'),
  result?: boolean(name='Result', description='Indicates whether the involved resources were evaluated. Valid values:

*   true: The involved resources were evaluated.
*   false: The involved resources were not evaluated', example='true'),
}

model StartAggregateConfigRuleEvaluationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartAggregateConfigRuleEvaluationResponseBody(name='body'),
}

/**
 * @summary Re-evaluates the compliance of resources based on a rule or based on all rules in a compliance package in a specific account group.
 *
 * @description > After you call this operation, the compliance evaluation is performed only once. To query the compliance evaluation results returned by the rule, call the ListAggregateConfigRuleEvaluationResults operation. For more information, see [ListAggregateConfigRuleEvaluationResults](https://help.aliyun.com/document_detail/265979.html).
 * The sample request in this topic shows how to use the `cr-c169626622af009f****` rule in the `ca-3a58626622af0005****` account group to evaluate resources.
 *
 * @param request StartAggregateConfigRuleEvaluationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartAggregateConfigRuleEvaluationResponse
 */
async function startAggregateConfigRuleEvaluationWithOptions(request: StartAggregateConfigRuleEvaluationRequest, runtime: Util.RuntimeOptions): StartAggregateConfigRuleEvaluationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.revertEvaluation)) {
    query['RevertEvaluation'] = request.revertEvaluation;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartAggregateConfigRuleEvaluation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Re-evaluates the compliance of resources based on a rule or based on all rules in a compliance package in a specific account group.
 *
 * @description > After you call this operation, the compliance evaluation is performed only once. To query the compliance evaluation results returned by the rule, call the ListAggregateConfigRuleEvaluationResults operation. For more information, see [ListAggregateConfigRuleEvaluationResults](https://help.aliyun.com/document_detail/265979.html).
 * The sample request in this topic shows how to use the `cr-c169626622af009f****` rule in the `ca-3a58626622af0005****` account group to evaluate resources.
 *
 * @param request StartAggregateConfigRuleEvaluationRequest
 * @return StartAggregateConfigRuleEvaluationResponse
 */
async function startAggregateConfigRuleEvaluation(request: StartAggregateConfigRuleEvaluationRequest): StartAggregateConfigRuleEvaluationResponse {
  var runtime = new Util.RuntimeOptions{};
  return startAggregateConfigRuleEvaluationWithOptions(request, runtime);
}

model StartAggregateRemediationRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-6b4a626622af0012****'),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-6b7c626622af00b4****'),
  resourceAccountId?: long(name='ResourceAccountId', description='The ID of the Alibaba Cloud account to which the resources to be remediated belong. If this parameter is left empty, non-compliant resources of all accounts in the account group are remediated.

> You must specify the ID of the current management account or a member account in the account group of the management account.', example='100271897542****'),
}

model StartAggregateRemediationResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}

model StartAggregateRemediationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartAggregateRemediationResponseBody(name='body'),
}

/**
 * @summary Performs a remediation operation by using a rule in an account group.
 *
 * @description This topic provides an example on how to manually perform a remediation operation by using the rule whose ID is `cr-6b7c626622af00b4****` in the account group whose ID is `ca-6b4a626622af0012****`. The return result shows that the manual execution is successful.
 *
 * @param request StartAggregateRemediationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartAggregateRemediationResponse
 */
async function startAggregateRemediationWithOptions(request: StartAggregateRemediationRequest, runtime: Util.RuntimeOptions): StartAggregateRemediationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.resourceAccountId)) {
    query['ResourceAccountId'] = request.resourceAccountId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartAggregateRemediation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Performs a remediation operation by using a rule in an account group.
 *
 * @description This topic provides an example on how to manually perform a remediation operation by using the rule whose ID is `cr-6b7c626622af00b4****` in the account group whose ID is `ca-6b4a626622af0012****`. The return result shows that the manual execution is successful.
 *
 * @param request StartAggregateRemediationRequest
 * @return StartAggregateRemediationResponse
 */
async function startAggregateRemediation(request: StartAggregateRemediationRequest): StartAggregateRemediationResponse {
  var runtime = new Util.RuntimeOptions{};
  return startAggregateRemediationWithOptions(request, runtime);
}

model StartConfigRuleEvaluationRequest {
  compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/606968.html).

>  You must configure either the `CompliancePackId` or `ConfigRuleId` parameter.', example='cp-ac16626622af0053****'),
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

You can call the [ListConfigRules](https://help.aliyun.com/document_detail/609222.html) operation to obtain the rule ID.

>  You must configure either the `CompliancePackId` or `ConfigRuleId` parameter.', example='cr-9920626622af0035****'),
  revertEvaluation?: boolean(name='RevertEvaluation', description='Specifies whether to re-evaluate the ignored non-compliant resource. Valid values:

*   true: re-evaluates the ignored non-compliant resource based on the rule.
*   false (default): does not re-evaluate the ignored non-compliant resource based on the rule.', example='false'),
}

model StartConfigRuleEvaluationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D31EEAD7-BF1E-5927-977A-AFF9342A7273'),
  result?: boolean(name='Result', description='Indicates whether the operation is successful. Valid values:

*   true
*   false', example='true'),
}

model StartConfigRuleEvaluationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartConfigRuleEvaluationResponseBody(name='body'),
}

/**
 * @summary Re-evaluates the compliance of resources based on a rule or based on all rules in a compliance package.
 *
 * @description In this example, the cr-9920626622af0035\\*\\*\\*\\* rule is used to re-evaluate the compliance of resources.
 *
 * @param request StartConfigRuleEvaluationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartConfigRuleEvaluationResponse
 */
async function startConfigRuleEvaluationWithOptions(request: StartConfigRuleEvaluationRequest, runtime: Util.RuntimeOptions): StartConfigRuleEvaluationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compliancePackId)) {
    query['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.revertEvaluation)) {
    query['RevertEvaluation'] = request.revertEvaluation;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartConfigRuleEvaluation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Re-evaluates the compliance of resources based on a rule or based on all rules in a compliance package.
 *
 * @description In this example, the cr-9920626622af0035\\*\\*\\*\\* rule is used to re-evaluate the compliance of resources.
 *
 * @param request StartConfigRuleEvaluationRequest
 * @return StartConfigRuleEvaluationResponse
 */
async function startConfigRuleEvaluation(request: StartConfigRuleEvaluationRequest): StartConfigRuleEvaluationResponse {
  var runtime = new Util.RuntimeOptions{};
  return startConfigRuleEvaluationWithOptions(request, runtime);
}

model StartConfigurationRecorderResponseBody = {
  configurationRecorder?: {
    configurationRecorderStatus?: string(name='ConfigurationRecorderStatus', description='The status of the configuration recorder. Valid values:

*   REGISTRABLE: The configuration recorder has not been registered.
*   BUILDING: The configuration recorder is being deployed.
*   REGISTERED: The configuration recorder has been registered.
*   REBUILDING: The configuration recorder is being redeployed.', example='REGISTERED'),
    resourceTypes?: [ string ](name='ResourceTypes', description='The types of the resources that are monitored by Cloud Config.'),
  }(name='ConfigurationRecorder', description='The details of the configuration recorder.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4D994662-6B27-536F-B320-38F4B3D58705'),
}

model StartConfigurationRecorderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartConfigurationRecorderResponseBody(name='body'),
}

/**
 * @summary Enables Cloud Config to monitor the resources of your Alibaba Cloud account.
 *
 * @description This topic provides an example on how to enable Cloud Config to monitor the resources of your Alibaba Cloud account.
 *
 * @param request StartConfigurationRecorderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartConfigurationRecorderResponse
 */
async function startConfigurationRecorderWithOptions(runtime: Util.RuntimeOptions): StartConfigurationRecorderResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'StartConfigurationRecorder',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables Cloud Config to monitor the resources of your Alibaba Cloud account.
 *
 * @description This topic provides an example on how to enable Cloud Config to monitor the resources of your Alibaba Cloud account.
 *
 * @return StartConfigurationRecorderResponse
 */
async function startConfigurationRecorder(): StartConfigurationRecorderResponse {
  var runtime = new Util.RuntimeOptions{};
  return startConfigurationRecorderWithOptions(runtime);
}

model StartRemediationRequest {
  configRuleId?: string(name='ConfigRuleId', description='The rule ID.

For more information about how to obtain the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-8a973ac2e2be00a2****'),
}

model StartRemediationResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}

model StartRemediationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartRemediationResponseBody(name='body'),
}

/**
 * @summary Performs a remediation operation by using a rule.
 *
 * @description This topic provides an example on how to perform a remediation operation by using the rule whose ID is `cr-8a973ac2e2be00a2****`. The returned result shows that the manual execution is successful.
 *
 * @param request StartRemediationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartRemediationResponse
 */
async function startRemediationWithOptions(request: StartRemediationRequest, runtime: Util.RuntimeOptions): StartRemediationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configRuleId)) {
    query['ConfigRuleId'] = request.configRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartRemediation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Performs a remediation operation by using a rule.
 *
 * @description This topic provides an example on how to perform a remediation operation by using the rule whose ID is `cr-8a973ac2e2be00a2****`. The returned result shows that the manual execution is successful.
 *
 * @param request StartRemediationRequest
 * @return StartRemediationResponse
 */
async function startRemediation(request: StartRemediationRequest): StartRemediationResponse {
  var runtime = new Util.RuntimeOptions{};
  return startRemediationWithOptions(request, runtime);
}

model StopConfigurationRecorderResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='AB2E892E-8A43-5B0F-8FE3-B53ADA53CB2D'),
  stopConfigurationRecorderResult?: boolean(name='StopConfigurationRecorderResult', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
}

model StopConfigurationRecorderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopConfigurationRecorderResponseBody(name='body'),
}

/**
 * @summary Deactivates Cloud Config.
 *
 * @description >  After you deactivate Cloud Config, the resource configurations, created rules, and compliance evaluation results that are stored in Cloud Config are automatically cleared and cannot be restored. Proceed with caution.
 *
 * @param request StopConfigurationRecorderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopConfigurationRecorderResponse
 */
async function stopConfigurationRecorderWithOptions(runtime: Util.RuntimeOptions): StopConfigurationRecorderResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'StopConfigurationRecorder',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deactivates Cloud Config.
 *
 * @description >  After you deactivate Cloud Config, the resource configurations, created rules, and compliance evaluation results that are stored in Cloud Config are automatically cleared and cannot be restored. Proceed with caution.
 *
 * @return StopConfigurationRecorderResponse
 */
async function stopConfigurationRecorder(): StopConfigurationRecorderResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopConfigurationRecorderWithOptions(runtime);
}

model TagResourcesRequest {
  regionId?: string(name='RegionId', description='The region ID of the tags.

This parameter is required.', example='cn-shanghai'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs. You can add tags to up to 50 resources.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   `ACS::Config::Rule`
*   `ACS::Config::AggregateConfigRule`
*   `ACS::Config::Aggregator`
*   `ACS::Config::CompliancePack`
*   `ACS::Config::AggregateCompliancePack`

This parameter is required.', example='ACS::Config::Rule'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag that is added to the resource.

You can add up to 20 tag keys to a resource.', example='Env'),
      value?: string(name='Value', description='The value of the tag that is added to the resource.

You can add up to 20 tag values to a resource.', example='prod'),
    }
  ](name='Tag', description='The tag value of the resource.

You can specify up to 20 tag values.

This parameter is required.'),
}

model TagResourcesShrinkRequest {
  regionId?: string(name='RegionId', description='The region ID of the tags.

This parameter is required.', example='cn-shanghai'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs. You can add tags to up to 50 resources.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   `ACS::Config::Rule`
*   `ACS::Config::AggregateConfigRule`
*   `ACS::Config::Aggregator`
*   `ACS::Config::CompliancePack`
*   `ACS::Config::AggregateCompliancePack`

This parameter is required.', example='ACS::Config::Rule'),
  tagShrink?: string(name='Tag', description='The tag value of the resource.

You can specify up to 20 tag values.

This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='AB2E4317-06A6-5745-B7C3-E001E551B380'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds tags to resources.
 *
 * @param tmpReq TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(tmpReq: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(tmpReq);
  var request = new TagResourcesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagShrink)) {
    body['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds tags to resources.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags from the resource. Valid values:

*   true: All tags are removed from the resource.
*   false (default): The specified tags are removed from the resource.', example='false'),
  regionId?: string(name='RegionId', description='The region ID of the tag.

This parameter is required.', example='cn-shanghai'),
  resourceId?: [ string ](name='ResourceId', description='The resource ID.

You can remove tags from up to 50 resources at a time.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   `ACS::Config::Rule`
*   `ACS::Config::AggregateConfigRule`
*   `ACS::Config::Aggregator`
*   `ACS::Config::CompliancePack`
*   `ACS::Config::AggregateCompliancePack`

This parameter is required.', example='ACS::Config::Rule'),
  tagKey?: [ string ](name='TagKey', description='The tags of the resource.'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='AB2E4317-06A6-5745-B7C3-E001E551B380'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes tags from specified resources.
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    body['All'] = request.all;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    body['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes tags from specified resources.
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateAggregateCompliancePackRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-fdc8626622af00f9****'),
  compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.

For more information about how to obtain the name of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).', example='test-pack-name'),
  configRules?: [ 
    {
      configRuleId?: string(name='ConfigRuleId', description='The rule ID. If you specify this parameter, Cloud Config adds the rule that has the specified ID to the compliance package.

You only need to configure the `ManagedRuleIdentifier` or `ConfigRuleId` parameter. If you configure both parameters, the value of the `ConfigRuleId` parameter takes precedence. For more information about how to obtain the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='cr-e918626622af000f****'),
      configRuleName?: string(name='ConfigRuleName', description='The rule name.', example='test-rule-name'),
      configRuleParameters?: [ 
        {
          parameterName?: string(name='ParameterName', description='The name of the input parameter.

You must specify both `ParameterName` and `ParameterValue` or neither of them. If the managed rule has an input parameter but no default value exists, you must configure this parameter. For more information about how to obtain the name of an input parameter for a managed rule, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='bandwidth'),
          parameterValue?: string(name='ParameterValue', description='The value of the input parameter.

You must specify both `ParameterName` and `ParameterValue` or neither of them. If the managed rule has an input parameter but no default value exists, you must configure this parameter. For more information about how to obtain the value of an input parameter for a managed rule, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='20'),
        }
      ](name='ConfigRuleParameters', description='The details of the input parameter of the rule.'),
      description?: string(name='Description', description='The rule description.', example='The description of the test rule.'),
      managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The identifier of the managed rule. Cloud Config automatically creates a rule based on the identifier of the managed rule and adds the rule to the current compliance package.

You need to only configure the `ManagedRuleIdentifier` or `ConfigRuleId` parameter. If you configure both parameters, the value of the `ConfigRuleId` parameter takes precedence. You can call the [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html) operation to obtain the identifier of the managed rule.', example='eip-bandwidth-limit'),
      riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
    }
  ](name='ConfigRules', description='The rules in the compliance package.

If you leave this parameter empty, the rules in the compliance package remain unchanged. If you set this parameter, Cloud Config replaces the existing rules in the compliance package with the specified rules.'),
  description?: string(name='Description', description='The description of the compliance package.', example='Test compliance pack description.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-2'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
  tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.

>  You must configure the TagValueScope parameter together with the TagKeyScope parameter.', example='test'),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
    }
  ](name='TagsScope', description='TagsScope'),
}

model UpdateAggregateCompliancePackShrinkRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-f632626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).

This parameter is required.', example='cp-fdc8626622af00f9****'),
  compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.

For more information about how to obtain the name of a compliance package, see [ListAggregateCompliancePacks](https://help.aliyun.com/document_detail/262059.html).', example='test-pack-name'),
  configRulesShrink?: string(name='ConfigRules', description='The rules in the compliance package.

If you leave this parameter empty, the rules in the compliance package remain unchanged. If you set this parameter, Cloud Config replaces the existing rules in the compliance package with the specified rules.'),
  description?: string(name='Description', description='The description of the compliance package.', example='Test compliance pack description.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package. Separate multiple resource IDs with commas (,).', example='eip-8vbf3x310fn56ijfd****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-2'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
  tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.

>  You must configure the TagValueScope parameter together with the TagKeyScope parameter.', example='test'),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
    }
  ](name='TagsScope', description='TagsScope'),
}

model UpdateAggregateCompliancePackResponseBody = {
  compliancePackId?: string(name='CompliancePackId', description='The compliance package ID.', example='ca-f632626622af0079****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model UpdateAggregateCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAggregateCompliancePackResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a compliance package in an account group.
 *
 * @description This topic provides an example on how to change the value of the `eip-bandwidth-limit` parameter in the rule template of the compliance package `cp-fdc8626622af00f9****` in the account group `ca-f632626622af0079****` to `20`.
 *
 * @param tmpReq UpdateAggregateCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAggregateCompliancePackResponse
 */
async function updateAggregateCompliancePackWithOptions(tmpReq: UpdateAggregateCompliancePackRequest, runtime: Util.RuntimeOptions): UpdateAggregateCompliancePackResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAggregateCompliancePackShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.configRules)) {
    request.configRulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.configRules, 'ConfigRules', 'json');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    body['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.compliancePackName)) {
    body['CompliancePackName'] = request.compliancePackName;
  }
  if (!Util.isUnset(request.configRulesShrink)) {
    body['ConfigRules'] = request.configRulesShrink;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.excludeRegionIdsScope)) {
    body['ExcludeRegionIdsScope'] = request.excludeRegionIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceGroupIdsScope)) {
    body['ExcludeResourceGroupIdsScope'] = request.excludeResourceGroupIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceIdsScope)) {
    body['ExcludeResourceIdsScope'] = request.excludeResourceIdsScope;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.excludeTagsScope)) {
    bodyFlat['ExcludeTagsScope'] = request.excludeTagsScope;
  }
  if (!Util.isUnset(request.regionIdsScope)) {
    body['RegionIdsScope'] = request.regionIdsScope;
  }
  if (!Util.isUnset(request.resourceGroupIdsScope)) {
    body['ResourceGroupIdsScope'] = request.resourceGroupIdsScope;
  }
  if (!Util.isUnset(request.resourceIdsScope)) {
    body['ResourceIdsScope'] = request.resourceIdsScope;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.tagKeyScope)) {
    body['TagKeyScope'] = request.tagKeyScope;
  }
  if (!Util.isUnset(request.tagValueScope)) {
    body['TagValueScope'] = request.tagValueScope;
  }
  if (!Util.isUnset(request.tagsScope)) {
    bodyFlat['TagsScope'] = request.tagsScope;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAggregateCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the configurations of a compliance package in an account group.
 *
 * @description This topic provides an example on how to change the value of the `eip-bandwidth-limit` parameter in the rule template of the compliance package `cp-fdc8626622af00f9****` in the account group `ca-f632626622af0079****` to `20`.
 *
 * @param request UpdateAggregateCompliancePackRequest
 * @return UpdateAggregateCompliancePackResponse
 */
async function updateAggregateCompliancePack(request: UpdateAggregateCompliancePackRequest): UpdateAggregateCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAggregateCompliancePackWithOptions(request, runtime);
}

model UpdateAggregateConfigDeliveryChannelRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of the account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests.

The `token` can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [Ensure idempotence](https://help.aliyun.com/document_detail/25693.html)', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliantSnapshot?: boolean(name='CompliantSnapshot', description='Specifies whether to deliver scheduled compliant snapshots. Cloud Config delivers scheduled compliant snapshots at `04:00Z` and `16:00Z` to Log Service every day. The time is displayed in UTC. Valid values:

*   true: Cloud Config delivers scheduled compliant snapshots.
*   false (default): Cloud Config does not deliver scheduled compliant snapshots.', example='false', nullable=true),
  configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Specifies whether to deliver resource change logs. If you set this parameter to true, Cloud Config delivers resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true: Cloud Config delivers resource change logs.
*   false (default): Cloud Config does not deliver resource change logs.

> This parameter is available for delivery channels of the OSS, SLS, and MNS types.', example='false', nullable=true),
  configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Specifies whether to deliver scheduled resource snapshots. Cloud Config delivers scheduled resource snapshots at `04:00Z` and `16:00Z` to OSS, MNS, or Log Service every day. The time is displayed in UTC. Valid values:

*   true: Cloud Config delivers scheduled resource snapshots.
*   false (default): Cloud Config does not deliver scheduled resource snapshots.', example='false', nullable=true),
  deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that is attached to the delivery channel. This parameter is available when you deliver data of all types to MNS or deliver snapshots to Log Service.

*   If the value of the DeliveryChannelType parameter is MNS, take note of the following settings of the lowest risk level and resource types of the events to which you subscribed:

    *   The lowest risk level of the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

        The `value` field indicates the lowest risk level of the events to which you subscribed. Valid values: 1, 2, and 3, where 1 indicates the high risk level, 2 indicates the medium risk level, and 3 indicates the low risk level.

    *   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

        The `values` field indicates the resource types of the events to which you subscribed. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`

*   If you set the DeliveryChannelType parameter to SLS, the setting of the resource types of the snapshots to which you want to deliver is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the snapshots to which you want to deliver. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.

For more information about how to obtain the ID of a delivery channel, see [ListAggregateConfigDeliveryChannels](https://help.aliyun.com/document_detail/429842.html).

This parameter is required.', example='cdc-8e45ff4e06a3a8****'),
  deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.', example='testoss'),
  deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The ARN of the delivery destination. Valid values:

*   `acs:oss:{RegionId}:{accountId}:{bucketName}` if your delivery destination is an OSS bucket. Example: `acs:oss:cn-shanghai:100931896542****:new-bucket`.
*   `acs:mns:{RegionId}:{accountId}:/topics/{topicName}` if your delivery destination is an MNS topic. Example: `acs:mns:cn-shanghai:100931896542****:/topics/topic1`.
*   `acs:log:{RegionId}:{accountId}:project/{projectName}/logstore/{logstoreName}` if your delivery destination is a Log Service Logstore. Example: `acs:log:cn-shanghai:100931896542****:project/project1/logstore/logstore1`.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  deliverySnapshotTime?: string(name='DeliverySnapshotTime', description='The time when Cloud Config delivers scheduled resources snapshots every day.

Format: `HH:mmZ`. This time is displayed in UTC.

> When you enable the scheduled resource delivery feature, you can specify a custom delivery time for this parameter. If you do not configure this parameter, Cloud Config automatically delivers scheduled resource snapshots at `04:00Z` and `16:00Z` every day.', example='09:10Z'),
  description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
  nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Specifies whether to deliver resource non-compliance events. If you set this parameter to true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are considered non-compliant. Valid values:

*   true: Cloud Config delivers resource non-compliance events.
*   false (default): Cloud Config does not deliver resource non-compliance events.

> This parameter is available only for delivery channels of the SLS or MNS type.', example='false', nullable=true),
  oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which the delivered data is transferred when the size of the data exceeds the specified upper limit of the delivery channel. Format: `acs:oss:{RegionId}:{accountId}:{bucketName}`.

If you do not configure this parameter, Cloud Config delivers only summary data.

> This parameter is available only for delivery channels of the SLS or MNS type. The upper limit on the storage size of delivery channels of the SLS type is 1 MB, and the upper limit on the storage size of delivery channels of the MNS type is 64 KB.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  status?: long(name='Status', description='Specifies whether to enable the delivery channel. Valid values:

*   0: The delivery channel is disabled. Cloud Config retains the most recent delivery configuration and stops resource data delivery.
*   1 (default): The delivery channel is enabled.', example='0'),
}

model UpdateAggregateConfigDeliveryChannelResponseBody = {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-8e45ff4e06a3a8****'),
  requestId?: string(name='RequestId', description='The request ID.', example='A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG'),
}

model UpdateAggregateConfigDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAggregateConfigDeliveryChannelResponseBody(name='body'),
}

/**
 * @summary Modifies a delivery channel in an account group.
 *
 * @description This topic provides an example on how to disable a delivery channel in an account group. The ID of the account group is `ca-a4e5626622af0079****`, and the ID of the delivery channel is `cdc-8e45ff4e06a3a8****`. The Status parameter is set to `0`. After the delivery channel is disabled, Cloud Config retains the most recent delivery configuration and stops resource data delivery.
 *
 * @param request UpdateAggregateConfigDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAggregateConfigDeliveryChannelResponse
 */
async function updateAggregateConfigDeliveryChannelWithOptions(request: UpdateAggregateConfigDeliveryChannelRequest, runtime: Util.RuntimeOptions): UpdateAggregateConfigDeliveryChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregatorId)) {
    query['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliantSnapshot)) {
    query['CompliantSnapshot'] = request.compliantSnapshot;
  }
  if (!Util.isUnset(request.configurationItemChangeNotification)) {
    query['ConfigurationItemChangeNotification'] = request.configurationItemChangeNotification;
  }
  if (!Util.isUnset(request.configurationSnapshot)) {
    query['ConfigurationSnapshot'] = request.configurationSnapshot;
  }
  if (!Util.isUnset(request.deliveryChannelCondition)) {
    query['DeliveryChannelCondition'] = request.deliveryChannelCondition;
  }
  if (!Util.isUnset(request.deliveryChannelId)) {
    query['DeliveryChannelId'] = request.deliveryChannelId;
  }
  if (!Util.isUnset(request.deliveryChannelName)) {
    query['DeliveryChannelName'] = request.deliveryChannelName;
  }
  if (!Util.isUnset(request.deliveryChannelTargetArn)) {
    query['DeliveryChannelTargetArn'] = request.deliveryChannelTargetArn;
  }
  if (!Util.isUnset(request.deliverySnapshotTime)) {
    query['DeliverySnapshotTime'] = request.deliverySnapshotTime;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.nonCompliantNotification)) {
    query['NonCompliantNotification'] = request.nonCompliantNotification;
  }
  if (!Util.isUnset(request.oversizedDataOSSTargetArn)) {
    query['OversizedDataOSSTargetArn'] = request.oversizedDataOSSTargetArn;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAggregateConfigDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a delivery channel in an account group.
 *
 * @description This topic provides an example on how to disable a delivery channel in an account group. The ID of the account group is `ca-a4e5626622af0079****`, and the ID of the delivery channel is `cdc-8e45ff4e06a3a8****`. The Status parameter is set to `0`. After the delivery channel is disabled, Cloud Config retains the most recent delivery configuration and stops resource data delivery.
 *
 * @param request UpdateAggregateConfigDeliveryChannelRequest
 * @return UpdateAggregateConfigDeliveryChannelResponse
 */
async function updateAggregateConfigDeliveryChannel(request: UpdateAggregateConfigDeliveryChannelRequest): UpdateAggregateConfigDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAggregateConfigDeliveryChannelWithOptions(request, runtime);
}

model UpdateAggregateConfigRuleRequest {
  accountIdsScope?: string(name='AccountIdsScope', description='The IDs of the member accounts to which the rule applies, which means that the resources within the member accounts are evaluated based on the rule. Separate multiple member account IDs with commas (,).', example='115748125982****'),
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to query the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to query the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-4e3d626622af0080****'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.

For more information about how to query the name of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='test_rule'),
  configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.

>  This parameter applies only to a custom rule.', example='ConfigurationItemChangeNotification'),
  description?: string(name='Description', description='The description of the rule.', example='test_description'),
  excludeAccountIdsScope?: string(name='ExcludeAccountIdsScope', description='The IDs of the member accounts to which the rule does not apply, which means that the resources within the member accounts are not evaluated based on the rule. Separate multiple member account IDs with commas (,).

>  This parameter applies only to a managed rule.', example='120886317861****'),
  excludeFolderIdsScope?: string(name='ExcludeFolderIdsScope', description='The IDs of the resource directories to which the rule does not apply, which means that the resources within member accounts in the resource directories are not evaluated based on the rule. Separate multiple resource directory IDs with commas (,).

> 

*   This parameter applies only to a rule of a global account group.

*   This parameter applies only to a managed rule.', example='fd-pWmkqZ****'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups to which the rule not applies. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The IDs of the resources excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

>  This parameter applies only to a managed rule.', example='lb-t4nbowvtbkss7t326****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-2'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='Exclude the specific tag scope of resources .'),
  folderIdsScope?: string(name='FolderIdsScope', description='The IDs of the resource directories to which the rule applies, which means that the resources within member accounts in the resource directories are evaluated based on the rule.

> 

*   This parameter applies only to a rule of a global account group.

*   This parameter applies only to a managed rule.', example='fd-ZtHsRH****'),
  inputParameters?: map[string]any(name='InputParameters', description='The input parameters of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
  maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours

>  This parameter is required if the `ConfigRuleTriggerTypes` parameter is set to `ScheduledNotification`.', example='One_Hour'),
  regionIdsScope?: string(name='RegionIdsScope', description='The IDs of the regions to which the rule applies. Separate multiple region IDs with commas (,).

>  This parameter applies only to a managed rule.', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The IDs of the resource groups to which the rule applies. Separate multiple resource group IDs with commas (,).

>  This parameter applies only to a managed rule.', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
  resourceTypesScope?: [ string ](name='ResourceTypesScope', description='The type of the resource to be evaluated by the rule. Separate multiple resource types with commas (,).', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='3'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyLogicScope?: string(name='TagKeyLogicScope', description='The logical relationship when parameter `TagsScope` takes multiple values, for example: When the parameter `TagsScope` is `"TagsScope.1.TagKey":"a", "TagsScope.1.TagValue":"a", "TagsScope.2.TagKey":"b", "TagsScope.2.TagValue":"b"`, if this parameter is set to` AND`, it means that the rule only applies to resources bound with both tags `a:a` and `b:b`. If not specified, the default logic is `OR`.

It can also be used for the deprecated field `TagKeyScope` (not recommended), for example: When the parameter `TagKeyScope` has a value of `ECS`,`OSS`, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels `ECS` and `OSS`.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
  tagKeyScope?: string(name='TagKeyScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag key used to filter resources. The rule applies only to the resources with the specified tag key.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='ECS', deprecated=true),
  tagValueScope?: string(name='TagValueScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='test', deprecated=true),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
    }
  ](name='TagsScope', description='The valid tag scope of resources.'),
}

model UpdateAggregateConfigRuleShrinkRequest {
  accountIdsScope?: string(name='AccountIdsScope', description='The IDs of the member accounts to which the rule applies, which means that the resources within the member accounts are evaluated based on the rule. Separate multiple member account IDs with commas (,).', example='115748125982****'),
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to query the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-a4e5626622af0079****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to query the ID of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).

This parameter is required.', example='cr-4e3d626622af0080****'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.

For more information about how to query the name of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='test_rule'),
  configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.

>  This parameter applies only to a custom rule.', example='ConfigurationItemChangeNotification'),
  description?: string(name='Description', description='The description of the rule.', example='test_description'),
  excludeAccountIdsScope?: string(name='ExcludeAccountIdsScope', description='The IDs of the member accounts to which the rule does not apply, which means that the resources within the member accounts are not evaluated based on the rule. Separate multiple member account IDs with commas (,).

>  This parameter applies only to a managed rule.', example='120886317861****'),
  excludeFolderIdsScope?: string(name='ExcludeFolderIdsScope', description='The IDs of the resource directories to which the rule does not apply, which means that the resources within member accounts in the resource directories are not evaluated based on the rule. Separate multiple resource directory IDs with commas (,).

> 

*   This parameter applies only to a rule of a global account group.

*   This parameter applies only to a managed rule.', example='fd-pWmkqZ****'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups to which the rule not applies. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The IDs of the resources excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

>  This parameter applies only to a managed rule.', example='lb-t4nbowvtbkss7t326****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-2'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='Exclude the specific tag scope of resources .'),
  folderIdsScope?: string(name='FolderIdsScope', description='The IDs of the resource directories to which the rule applies, which means that the resources within member accounts in the resource directories are evaluated based on the rule.

> 

*   This parameter applies only to a rule of a global account group.

*   This parameter applies only to a managed rule.', example='fd-ZtHsRH****'),
  inputParametersShrink?: string(name='InputParameters', description='The input parameters of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
  maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours

>  This parameter is required if the `ConfigRuleTriggerTypes` parameter is set to `ScheduledNotification`.', example='One_Hour'),
  regionIdsScope?: string(name='RegionIdsScope', description='The IDs of the regions to which the rule applies. Separate multiple region IDs with commas (,).

>  This parameter applies only to a managed rule.', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The IDs of the resource groups to which the rule applies. Separate multiple resource group IDs with commas (,).

>  This parameter applies only to a managed rule.', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
  resourceTypesScopeShrink?: string(name='ResourceTypesScope', description='The type of the resource to be evaluated by the rule. Separate multiple resource types with commas (,).', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='3'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyLogicScope?: string(name='TagKeyLogicScope', description='The logical relationship when parameter `TagsScope` takes multiple values, for example: When the parameter `TagsScope` is `"TagsScope.1.TagKey":"a", "TagsScope.1.TagValue":"a", "TagsScope.2.TagKey":"b", "TagsScope.2.TagValue":"b"`, if this parameter is set to` AND`, it means that the rule only applies to resources bound with both tags `a:a` and `b:b`. If not specified, the default logic is `OR`.

It can also be used for the deprecated field `TagKeyScope` (not recommended), for example: When the parameter `TagKeyScope` has a value of `ECS`,`OSS`, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels `ECS` and `OSS`.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
  tagKeyScope?: string(name='TagKeyScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag key used to filter resources. The rule applies only to the resources with the specified tag key.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='ECS', deprecated=true),
  tagValueScope?: string(name='TagValueScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='test', deprecated=true),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
    }
  ](name='TagsScope', description='The valid tag scope of resources.'),
}

model UpdateAggregateConfigRuleResponseBody = {
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-4e3d626622af0080****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model UpdateAggregateConfigRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAggregateConfigRuleResponseBody(name='body'),
}

/**
 * @summary Modifies the description, input parameters, and risk level of a rule in a specific account group.
 *
 * @description This topic provides an example on how to change the risk level of the rule `cr-4e3d626622af0080****` in an account group `ca-a4e5626622af0079****` to `3`, which indicates low risk level.
 *
 * @param tmpReq UpdateAggregateConfigRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAggregateConfigRuleResponse
 */
async function updateAggregateConfigRuleWithOptions(tmpReq: UpdateAggregateConfigRuleRequest, runtime: Util.RuntimeOptions): UpdateAggregateConfigRuleResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAggregateConfigRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.inputParameters)) {
    request.inputParametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.inputParameters, 'InputParameters', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceTypesScope)) {
    request.resourceTypesScopeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceTypesScope, 'ResourceTypesScope', 'simple');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountIdsScope)) {
    body['AccountIdsScope'] = request.accountIdsScope;
  }
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configRuleId)) {
    body['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.configRuleName)) {
    body['ConfigRuleName'] = request.configRuleName;
  }
  if (!Util.isUnset(request.configRuleTriggerTypes)) {
    body['ConfigRuleTriggerTypes'] = request.configRuleTriggerTypes;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.excludeAccountIdsScope)) {
    body['ExcludeAccountIdsScope'] = request.excludeAccountIdsScope;
  }
  if (!Util.isUnset(request.excludeFolderIdsScope)) {
    body['ExcludeFolderIdsScope'] = request.excludeFolderIdsScope;
  }
  if (!Util.isUnset(request.excludeRegionIdsScope)) {
    body['ExcludeRegionIdsScope'] = request.excludeRegionIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceGroupIdsScope)) {
    body['ExcludeResourceGroupIdsScope'] = request.excludeResourceGroupIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceIdsScope)) {
    body['ExcludeResourceIdsScope'] = request.excludeResourceIdsScope;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.excludeTagsScope)) {
    bodyFlat['ExcludeTagsScope'] = request.excludeTagsScope;
  }
  if (!Util.isUnset(request.folderIdsScope)) {
    body['FolderIdsScope'] = request.folderIdsScope;
  }
  if (!Util.isUnset(request.inputParametersShrink)) {
    body['InputParameters'] = request.inputParametersShrink;
  }
  if (!Util.isUnset(request.maximumExecutionFrequency)) {
    body['MaximumExecutionFrequency'] = request.maximumExecutionFrequency;
  }
  if (!Util.isUnset(request.regionIdsScope)) {
    body['RegionIdsScope'] = request.regionIdsScope;
  }
  if (!Util.isUnset(request.resourceGroupIdsScope)) {
    body['ResourceGroupIdsScope'] = request.resourceGroupIdsScope;
  }
  if (!Util.isUnset(request.resourceIdsScope)) {
    body['ResourceIdsScope'] = request.resourceIdsScope;
  }
  if (!Util.isUnset(request.resourceNameScope)) {
    body['ResourceNameScope'] = request.resourceNameScope;
  }
  if (!Util.isUnset(request.resourceTypesScopeShrink)) {
    body['ResourceTypesScope'] = request.resourceTypesScopeShrink;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.tagKeyLogicScope)) {
    body['TagKeyLogicScope'] = request.tagKeyLogicScope;
  }
  if (!Util.isUnset(request.tagKeyScope)) {
    body['TagKeyScope'] = request.tagKeyScope;
  }
  if (!Util.isUnset(request.tagValueScope)) {
    body['TagValueScope'] = request.tagValueScope;
  }
  if (!Util.isUnset(request.tagsScope)) {
    bodyFlat['TagsScope'] = request.tagsScope;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAggregateConfigRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the description, input parameters, and risk level of a rule in a specific account group.
 *
 * @description This topic provides an example on how to change the risk level of the rule `cr-4e3d626622af0080****` in an account group `ca-a4e5626622af0079****` to `3`, which indicates low risk level.
 *
 * @param request UpdateAggregateConfigRuleRequest
 * @return UpdateAggregateConfigRuleResponse
 */
async function updateAggregateConfigRule(request: UpdateAggregateConfigRuleRequest): UpdateAggregateConfigRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAggregateConfigRuleWithOptions(request, runtime);
}

model UpdateAggregateRemediationRequest {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

You can the [ListAggregators](https://help.aliyun.com/document_detail/255797.html) operation to obtain the ID of the account group.

This parameter is required.', example='ca-6b4a626622af0012****'),
  invokeType?: string(name='InvokeType', description='The execution mode of the remediation. Valid values:

*   NON_EXECUTION: The remediation is not executed.
*   AUTO_EXECUTION: The remediation is automatically executed.
*   MANUAL_EXECUTION: The remediation is manually executed.
*   NOT_CONFIG: The execution mode is not specified.', example='AUTO_EXECUTION'),
  params?: string(name='Params', description='The desired parameter values of the remediation setting.', example='{"properties":[{"name":"regionId","type":"STRING","value":"{regionId}","allowedValues":[]},{"name":"bucketName","type":"STRING","value":"{resourceId}","allowedValues":[],"description":"OSS Bucket Name."},{"name":"permissionName","type":"STRING","value":"private","allowedValues":["public-read-write","public-read","private"],"description":"ACL Permission Name."}]}'),
  remediationId?: string(name='RemediationId', description='The ID of the remediation setting.

You can call the [ListAggregateRemediations](https://help.aliyun.com/document_detail/270036.html) operation to obtain the ID of the remediation setting.

This parameter is required.', example='crr-909ba2d4716700eb****'),
  remediationTemplateId?: string(name='RemediationTemplateId', description='The ID of the remediation template.

You can call the [ListRemediationTemplates](https://help.aliyun.com/document_detail/270066.html) operation to obtain the ID of the remediation template.', example='ACS-OSS-PutBucketAcl'),
  remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid values:

*   OOS: Operation Orchestration Service (OOS)
*   FC: Function Compute. You can use Function Compute to configure custom remediation settings.', example='OOS'),
  sourceType?: string(name='SourceType', description='The type of the rule for which the remediation template is configured. Valid values:

*   ALIYUN: managed rule.
*   CUSTOM: custom rule.
*   NONE: The rule is not specified.', example='ALIYUN'),
}

model UpdateAggregateRemediationResponseBody = {
  remediationId?: string(name='RemediationId', description='The ID of the remediation setting.', example='crr-909ba2d4716700eb****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}

model UpdateAggregateRemediationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAggregateRemediationResponseBody(name='body'),
}

/**
 * @summary Modifies a remediation template for a rule in an account group.
 *
 * @description This topic describes how to change the execution mode of the `crr-909ba2d4716700eb****` remediation setting for a rule in the `ca-6b4a626622af0012****` account group to `AUTO_EXECUTION`, which specifies automatic remediation. This topic also provides a sample request.
 *
 * @param request UpdateAggregateRemediationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAggregateRemediationResponse
 */
async function updateAggregateRemediationWithOptions(request: UpdateAggregateRemediationRequest, runtime: Util.RuntimeOptions): UpdateAggregateRemediationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.invokeType)) {
    body['InvokeType'] = request.invokeType;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }
  if (!Util.isUnset(request.remediationId)) {
    body['RemediationId'] = request.remediationId;
  }
  if (!Util.isUnset(request.remediationTemplateId)) {
    body['RemediationTemplateId'] = request.remediationTemplateId;
  }
  if (!Util.isUnset(request.remediationType)) {
    body['RemediationType'] = request.remediationType;
  }
  if (!Util.isUnset(request.sourceType)) {
    body['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAggregateRemediation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a remediation template for a rule in an account group.
 *
 * @description This topic describes how to change the execution mode of the `crr-909ba2d4716700eb****` remediation setting for a rule in the `ca-6b4a626622af0012****` account group to `AUTO_EXECUTION`, which specifies automatic remediation. This topic also provides a sample request.
 *
 * @param request UpdateAggregateRemediationRequest
 * @return UpdateAggregateRemediationResponse
 */
async function updateAggregateRemediation(request: UpdateAggregateRemediationRequest): UpdateAggregateRemediationResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAggregateRemediationWithOptions(request, runtime);
}

model UpdateAggregatorRequest {
  aggregatorAccounts?: [ 
    {
      accountId?: long(name='AccountId', description='The ID of the member.

For more information about how to obtain the ID of a member, see [ListAccounts](https://help.aliyun.com/document_detail/160016.html).

>  If you want to update the member list, you must configure both the `AccountId` and `AccountType` parameters.', example='173808452267****'),
      accountName?: string(name='AccountName', description='The display name of the member.

For more information about how to obtain the name of a member, see [ListAccounts](https://help.aliyun.com/document_detail/160016.html).

>  If you want to update the member list, you must configure both the `AccountId` and `AccountType` parameters.', example='Tony'),
      accountType?: string(name='AccountType', description='The resource directory to which the member belongs. Valid value: ResourceDirectory. ResourceDirectory indicates that the member belongs to a resource directory.

>  If you want to update the member list, you must configure both the `AccountId` and `AccountType` parameters.', example='ResourceDirectory'),
    }
  ](name='AggregatorAccounts', description='The members in the account group.

>  When you modify the configurations of an account group, this parameter can be left empty. In this case, the member list is not updated. If you want to update the member list, you must configure both the `AccountId` and `AccountType` parameters.', nullable=false),
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-dacf86d8314e00eb****'),
  aggregatorName?: string(name='AggregatorName', description='The name of the account group.

For more information about how to obtain the name of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).', example='Test_Group'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  description?: string(name='Description', description='The description of the account group.

For more information about how to obtain the description of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).', example='Test_Aggregator_Description'),
  folderId?: string(name='FolderId', description='The folder ID. Separate multiple folder IDs with commas (,).', example='fd-brHdgv****,fd-brHdgk****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the resource. You can specify up to 20 tag keys.

The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with `aliyun` or `acs`:. The tag key cannot contain `http://` or `https://`.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model UpdateAggregatorShrinkRequest {
  aggregatorAccountsShrink?: string(name='AggregatorAccounts', description='The members in the account group.

>  When you modify the configurations of an account group, this parameter can be left empty. In this case, the member list is not updated. If you want to update the member list, you must configure both the `AccountId` and `AccountType` parameters.', nullable=false),
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.

For more information about how to obtain the ID of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).

This parameter is required.', example='ca-dacf86d8314e00eb****'),
  aggregatorName?: string(name='AggregatorName', description='The name of the account group.

For more information about how to obtain the name of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).', example='Test_Group'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  description?: string(name='Description', description='The description of the account group.

For more information about how to obtain the description of an account group, see [ListAggregators](https://help.aliyun.com/document_detail/255797.html).', example='Test_Aggregator_Description'),
  folderId?: string(name='FolderId', description='The folder ID. Separate multiple folder IDs with commas (,).', example='fd-brHdgv****,fd-brHdgk****'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
}

model UpdateAggregatorResponseBody = {
  aggregatorId?: string(name='AggregatorId', description='The ID of the account group.', example='ca-dacf86d8314e00eb****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='8195B664-9565-4685-89AC-8B5F04B44B92'),
}

model UpdateAggregatorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAggregatorResponseBody(name='body'),
}

/**
 * @summary The management account or delegated administrator account of a resource directory can be used to modify the name and description of an account group. The management account or delegated administrator account can also be used to add or remove members from the account group.
 *
 * @description This topic provides an example on how to add a member to the account group `ca-dacf86d8314e00eb****`. The member ID is `173808452267****`, the member name is `Tony`, and the member belongs to the resource directory `ResourceDirectory`.
 *
 * @param tmpReq UpdateAggregatorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAggregatorResponse
 */
async function updateAggregatorWithOptions(tmpReq: UpdateAggregatorRequest, runtime: Util.RuntimeOptions): UpdateAggregatorResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAggregatorShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.aggregatorAccounts)) {
    request.aggregatorAccountsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.aggregatorAccounts, 'AggregatorAccounts', 'json');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorAccountsShrink)) {
    body['AggregatorAccounts'] = request.aggregatorAccountsShrink;
  }
  if (!Util.isUnset(request.aggregatorId)) {
    body['AggregatorId'] = request.aggregatorId;
  }
  if (!Util.isUnset(request.aggregatorName)) {
    body['AggregatorName'] = request.aggregatorName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.folderId)) {
    body['FolderId'] = request.folderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAggregator',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The management account or delegated administrator account of a resource directory can be used to modify the name and description of an account group. The management account or delegated administrator account can also be used to add or remove members from the account group.
 *
 * @description This topic provides an example on how to add a member to the account group `ca-dacf86d8314e00eb****`. The member ID is `173808452267****`, the member name is `Tony`, and the member belongs to the resource directory `ResourceDirectory`.
 *
 * @param request UpdateAggregatorRequest
 * @return UpdateAggregatorResponse
 */
async function updateAggregator(request: UpdateAggregatorRequest): UpdateAggregatorResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAggregatorWithOptions(request, runtime);
}

model UpdateCompliancePackRequest {
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-a8a8626622af0082****'),
  compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.

For more information about how to obtain the name of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).', example='The name of the compliance package.'),
  configRules?: [ 
    {
      configRuleId?: string(name='ConfigRuleId', description='The rule ID. If you configure this parameter, Cloud Config adds the rule that has the specified ID to the compliance package.

You need to only specify one of the `ManagedRuleIdentifier` and `ConfigRuleId` properties. If you specify both the properties, the value of the `ConfigRuleId` property takes precedence. You can call the [ListConfigRules](https://help.aliyun.com/document_detail/169607.html) operation to obtain the rule ID.', example='cr-e918626622af000f****'),
      configRuleName?: string(name='ConfigRuleName', description='The rule name.', example='The rule name.'),
      configRuleParameters?: [ 
        {
          parameterName?: string(name='ParameterName', description='The name of the managed rule parameter.

You must specify both `ParameterName` and `ParameterValue` or neither of them. If the managed rule has an input parameter but no default value exists, you must configure this parameter. For more information about how to obtain the name of an input parameter for a managed rule, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='bandwidth'),
          parameterValue?: string(name='ParameterValue', description='The value of the managed rule parameter.

You must configure the `ParameterName` and `ParameterValue` parameters or neither of them. If the managed rule has an input parameter but no default value exists, you must configure this parameter. For more information about how to obtain the value of an input parameter for a managed rule, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='20'),
        }
      ](name='ConfigRuleParameters', description='The details of the input parameter of the rule.'),
      description?: string(name='Description', description='The rule description.', example='The rule description.'),
      managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The identifier of the managed rule. Cloud Config automatically creates a rule based on the identifier of the managed rule and adds the rule to the current compliance package.

You need to only configure the `ManagedRuleIdentifier` or `ConfigRuleId` parameter. If you configure both parameters, the value of the `ConfigRuleId` parameter takes precedence. For more information about how to obtain the identifier of a managed rule, see [ListCompliancePackTemplates](https://help.aliyun.com/document_detail/261176.html).', example='eip-bandwidth-limit'),
      riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
    }
  ](name='ConfigRules', description='The rules in the compliance package.

If you leave this parameter empty, the rules in the compliance package remain unchanged. If you configure this parameter, Cloud Config replaces the existing rules in the compliance package with the specified rules.'),
  description?: string(name='Description', description='The description of the compliance package.', example='The description of the compliance package.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package. Separate multiple resource IDs with commas (,).', example='23642660635687****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-2'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzdibsjjc****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag keys.

The tag keys cannot be an empty string. The tag keys can be up to 64 characters in length. The tag keys cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

You can specify at most 20 tag keys in each call.', example='key-1'),
      value?: string(name='Value', description='The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.

Each key-value must be unique. You can specify at most 20 tag values in each call.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
  tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.

>  You must configure the TagValueScope parameter together with the TagValueScope parameter.', example='test'),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
    }
  ](name='TagsScope', description='TagsScope'),
}

model UpdateCompliancePackShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).

This parameter is required.', example='cp-a8a8626622af0082****'),
  compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.

For more information about how to obtain the name of a compliance package, see [ListCompliancePacks](https://help.aliyun.com/document_detail/263332.html).', example='The name of the compliance package.'),
  configRulesShrink?: string(name='ConfigRules', description='The rules in the compliance package.

If you leave this parameter empty, the rules in the compliance package remain unchanged. If you configure this parameter, Cloud Config replaces the existing rules in the compliance package with the specified rules.'),
  description?: string(name='Description', description='The description of the compliance package.', example='The description of the compliance package.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The ID of the resource that you do not want to evaluate by using the compliance package. Separate multiple resource IDs with commas (,).', example='23642660635687****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-2'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='ExcludeTagsScope'),
  regionIdsScope?: string(name='RegionIdsScope', description='The ID of the region whose resources you want to evaluate by using the compliance package. Separate multiple region IDs with commas (,).', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The ID of the resource group whose resources you want to evaluate by using the compliance package. Separate multiple resource group IDs with commas (,).', example='rg-aekzdibsjjc****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

*   1: high risk level
*   2: medium risk level
*   3: low risk level', example='1'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyScope?: string(name='TagKeyScope', description='The tag key of the resource that you want to evaluate by using the compliance package.', example='ECS'),
  tagValueScope?: string(name='TagValueScope', description='The tag value of the resource that you want to evaluate by using the compliance package.

>  You must configure the TagValueScope parameter together with the TagValueScope parameter.', example='test'),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='key-1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='value-1'),
    }
  ](name='TagsScope', description='TagsScope'),
}

model UpdateCompliancePackResponseBody = {
  compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-a8a8626622af0082****'),
  requestId?: string(name='RequestId', description='The request ID.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model UpdateCompliancePackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCompliancePackResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a specific compliance package in the current account.
 *
 * @description This topic provides an example on how to change the value of the `eip-bandwidth-limit` parameter of a rule in the compliance package `cp-a8a8626622af0082****` to `20`.
 *
 * @param tmpReq UpdateCompliancePackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCompliancePackResponse
 */
async function updateCompliancePackWithOptions(tmpReq: UpdateCompliancePackRequest, runtime: Util.RuntimeOptions): UpdateCompliancePackResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateCompliancePackShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.configRules)) {
    request.configRulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.configRules, 'ConfigRules', 'json');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliancePackId)) {
    body['CompliancePackId'] = request.compliancePackId;
  }
  if (!Util.isUnset(request.compliancePackName)) {
    body['CompliancePackName'] = request.compliancePackName;
  }
  if (!Util.isUnset(request.configRulesShrink)) {
    body['ConfigRules'] = request.configRulesShrink;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.excludeRegionIdsScope)) {
    body['ExcludeRegionIdsScope'] = request.excludeRegionIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceGroupIdsScope)) {
    body['ExcludeResourceGroupIdsScope'] = request.excludeResourceGroupIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceIdsScope)) {
    body['ExcludeResourceIdsScope'] = request.excludeResourceIdsScope;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.excludeTagsScope)) {
    bodyFlat['ExcludeTagsScope'] = request.excludeTagsScope;
  }
  if (!Util.isUnset(request.regionIdsScope)) {
    body['RegionIdsScope'] = request.regionIdsScope;
  }
  if (!Util.isUnset(request.resourceGroupIdsScope)) {
    body['ResourceGroupIdsScope'] = request.resourceGroupIdsScope;
  }
  if (!Util.isUnset(request.resourceIdsScope)) {
    body['ResourceIdsScope'] = request.resourceIdsScope;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.tagKeyScope)) {
    body['TagKeyScope'] = request.tagKeyScope;
  }
  if (!Util.isUnset(request.tagValueScope)) {
    body['TagValueScope'] = request.tagValueScope;
  }
  if (!Util.isUnset(request.tagsScope)) {
    bodyFlat['TagsScope'] = request.tagsScope;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCompliancePack',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the configurations of a specific compliance package in the current account.
 *
 * @description This topic provides an example on how to change the value of the `eip-bandwidth-limit` parameter of a rule in the compliance package `cp-a8a8626622af0082****` to `20`.
 *
 * @param request UpdateCompliancePackRequest
 * @return UpdateCompliancePackResponse
 */
async function updateCompliancePack(request: UpdateCompliancePackRequest): UpdateCompliancePackResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCompliancePackWithOptions(request, runtime);
}

model UpdateConfigDeliveryChannelRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must ensure that the token is unique among different requests.

The `token` can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [How to ensure idempotence](https://help.aliyun.com/document_detail/25693.html).', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  compliantSnapshot?: boolean(name='CompliantSnapshot', description='Specifies whether to deliver scheduled compliant snapshots. Cloud Config delivers scheduled compliant snapshots at `04:00Z` and `16:00Z` to  Log Service every day. The time is displayed in UTC. Valid values:

*   true: Cloud Config delivers compliant snapshots.
*   false (default): Cloud Config does not deliver scheduled compliant snapshots.', example='false', nullable=true),
  configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Specifies whether to deliver resource change logs. If you set this parameter to true, Cloud Config delivers resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true: Cloud Config delivers resource change logs.
*   false (default): Cloud Config does not deliver resource change logs.

> This parameter is available for delivery channels of the OSS, SLS, and MNS types.', example='false', nullable=true),
  configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Specifies whether to deliver scheduled resource snapshots. Cloud Config delivers scheduled resource snapshots at `04:00Z` and `16:00Z` to OSS, MNS, or Log Service every day. The time is displayed in UTC. Valid values:

*   true: Cloud Config delivers scheduled resource snapshots.
*   false (default): Cloud Config does not deliver scheduled resource snapshots.', example='false', nullable=true),
  deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that you want to attach to the delivery channel. This parameter is available when you deliver data of all types to MNS or deliver snapshots to Log Service.

*   If the value of the DeliveryChannelType parameter is MNS, take note of the following settings of the lowest risk level and resource types of the events to which you subscribed:

    *   The setting of the lowest risk level for the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

        The `value` field indicates the lowest risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

    *   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

        The `values` field indicates the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`

*   If you set the DeliveryChannelType parameter to SLS, the setting of the resource types of the snapshots to which you want to deliver is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the snapshots to which you want to deliver. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.

For more information about how to obtain the ID of a delivery channel, see [DescribeDeliveryChannels](https://help.aliyun.com/document_detail/429841.html).

This parameter is required.', example='cdc-8e45ff4e06a3a8****'),
  deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.', example='testoss'),
  deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The Alibaba Cloud Resource Name (ARN) of the delivery destination. Valid values:

*   `acs:oss:{RegionId}:{accountId}:{bucketName}` if your delivery destination is an OSS bucket. Example: `acs:oss:cn-shanghai:100931896542****:new-bucket`.
*   `acs:mns:{RegionId}:{accountId}:/topics/{topicName}` if your delivery destination is an MNS topic. Example: `acs:mns:cn-shanghai:100931896542****:/topics/topic1`.
*   `acs:log:{RegionId}:{accountId}:project/{projectName}/logstore/{logstoreName}` if your delivery destination is a Log Service Logstore. Example: `acs:log:cn-shanghai:100931896542****:project/project1/logstore/logstore1`.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  deliverySnapshotTime?: string(name='DeliverySnapshotTime', description='The time when you want Cloud Config to deliver scheduled resource snapshots every day.

Format: `HH:mmZ`. This time is displayed in UTC.

> When you enable the scheduled resource delivery feature, you can configure this parameter to specify a custom delivery time. If you do not configure this parameter, Cloud Config automatically delivers scheduled resource snapshots at `04:00Z` and `16:00Z` every day.', example='09:10Z'),
  description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
  nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Specifies whether to deliver resource non-compliance events. If you set this parameter to true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are considered non-compliant. Valid values:

*   true: Cloud Config delivers resource non-compliance events.
*   false (default): Cloud Config does not deliver resource non-compliance events.

> This parameter is available only for delivery channels of the SLS or MNS type.', example='false', nullable=true),
  oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel. Format: `acs:oss:{RegionId}:{accountId}:{bucketName}`.

If you do not configure this parameter, Cloud Config delivers only summary data.

> This parameter is available only for delivery channels of the SLS or MNS type. The maximum storage size of delivery channels of the SLS type is 1 MB, and the maximum storage size of delivery channels of the MNS type is 64 KB.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  status?: long(name='Status', description='Specifies whether to enable the delivery channel. Valid values:

*   0: Cloud Config disables the delivery channel. Cloud Config retains the most recent delivery configuration and stops resource data delivery.
*   1 (default): Cloud Config enables the delivery channel.', example='0'),
}

model UpdateConfigDeliveryChannelResponseBody = {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-8e45ff4e06a3a8****'),
  requestId?: string(name='RequestId', description='The request ID.', example='A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG'),
}

model UpdateConfigDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateConfigDeliveryChannelResponseBody(name='body'),
}

/**
 * @summary Modifies a delivery channel by using the current account.
 *
 * @description In this example, a delivery channel is disabled. The ID of the delivery channel is `cdc-8e45ff4e06a3a8****```. The Status parameter is set to 0. After the delivery channel is disabled, Cloud Config retains the most recent delivery configuration and stops the delivery of resource data.
 *
 * @param request UpdateConfigDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateConfigDeliveryChannelResponse
 */
async function updateConfigDeliveryChannelWithOptions(request: UpdateConfigDeliveryChannelRequest, runtime: Util.RuntimeOptions): UpdateConfigDeliveryChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compliantSnapshot)) {
    query['CompliantSnapshot'] = request.compliantSnapshot;
  }
  if (!Util.isUnset(request.configurationItemChangeNotification)) {
    query['ConfigurationItemChangeNotification'] = request.configurationItemChangeNotification;
  }
  if (!Util.isUnset(request.configurationSnapshot)) {
    query['ConfigurationSnapshot'] = request.configurationSnapshot;
  }
  if (!Util.isUnset(request.deliveryChannelCondition)) {
    query['DeliveryChannelCondition'] = request.deliveryChannelCondition;
  }
  if (!Util.isUnset(request.deliveryChannelId)) {
    query['DeliveryChannelId'] = request.deliveryChannelId;
  }
  if (!Util.isUnset(request.deliveryChannelName)) {
    query['DeliveryChannelName'] = request.deliveryChannelName;
  }
  if (!Util.isUnset(request.deliveryChannelTargetArn)) {
    query['DeliveryChannelTargetArn'] = request.deliveryChannelTargetArn;
  }
  if (!Util.isUnset(request.deliverySnapshotTime)) {
    query['DeliverySnapshotTime'] = request.deliverySnapshotTime;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.nonCompliantNotification)) {
    query['NonCompliantNotification'] = request.nonCompliantNotification;
  }
  if (!Util.isUnset(request.oversizedDataOSSTargetArn)) {
    query['OversizedDataOSSTargetArn'] = request.oversizedDataOSSTargetArn;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateConfigDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a delivery channel by using the current account.
 *
 * @description In this example, a delivery channel is disabled. The ID of the delivery channel is `cdc-8e45ff4e06a3a8****```. The Status parameter is set to 0. After the delivery channel is disabled, Cloud Config retains the most recent delivery configuration and stops the delivery of resource data.
 *
 * @param request UpdateConfigDeliveryChannelRequest
 * @return UpdateConfigDeliveryChannelResponse
 */
async function updateConfigDeliveryChannel(request: UpdateConfigDeliveryChannelRequest): UpdateConfigDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateConfigDeliveryChannelWithOptions(request, runtime);
}

model UpdateConfigRuleRequest {
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to query the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-a260626622af0005****'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.

For more information about how to query the name of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='The name of the rule.'),
  configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.

>  This parameter applies only to custom rules.', example='ConfigurationItemChangeNotification'),
  description?: string(name='Description', description='The description of the rule. You can enter up to 500 characters.', example='The description of the rule.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions excluded from the compliance evaluations performed by the rule. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups excluded from the compliance evaluations performed by the rule. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The IDs of the resources excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

>  This parameter applies only to a managed rule.', example='lb-t4nbowvtbkss7t326****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The key of the tag.', example='key-2'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='The scope of the tag that is excluded.'),
  extendContent?: string(name='ExtendContent', description='Optional. The extended content of the resource. This parameter can be used together with the MaximumExecutionFrequency parameter when the MaximumExecutionFrequency parameter is set to TwentyFour_Hours to specify the trigger time.', example='{"fixedHour":"12"}', nullable=true),
  inputParameters?: map[string]any(name='InputParameters', description='The input parameters of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
  maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours (default)

>  This parameter is required if the `ConfigRuleTriggerTypes` parameter is set to `ScheduledNotification`.', example='One_Hour'),
  regionIdsScope?: string(name='RegionIdsScope', description='The IDs of the regions to which the rule applies. Separate multiple region IDs with commas (,).

>  This parameter applies only to a managed rule.', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The IDs of the resource groups to which the rule applies. Separate multiple resource group IDs with commas (,).

>  This parameter applies only to a managed rule.', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources to which the rule applies. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
  resourceTypesScope?: [ string ](name='ResourceTypesScope', description='The type of the resource to be evaluated by the rule. Separate multiple resource types with commas (,).', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='3'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N to add to the key pair. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag key cannot start with `acs:` or `aliyun`.', example='key-1'),
      value?: string(name='Value', description='The value of tag N. Valid values of N: **1 to 20**. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag value cannot start with `aliyun` and `acs:`.', example='value-1'),
    }
  ](name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyLogicScope?: string(name='TagKeyLogicScope', description='The logical relationship when parameter `TagsScope` takes multiple values, for example: When the parameter `TagsScope` is `"TagsScope.1.TagKey":"a", "TagsScope.1.TagValue":"a", "TagsScope.2.TagKey":"b", "TagsScope.2.TagValue":"b"`, if this parameter is set to` AND`, it means that the rule only applies to resources bound with both tags `a:a` and `b:b`. If not specified, the default logic is `OR`.

It can also be used for the deprecated field `TagKeyScope` (not recommended), for example: When the parameter `TagKeyScope` has a value of `ECS`,`OSS`, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels `ECS` and `OSS`.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
  tagKeyScope?: string(name='TagKeyScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag key used to filter resources. The rule applies only to the resources with the specified tag key.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='ECS', deprecated=true),
  tagValueScope?: string(name='TagValueScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='test', deprecated=true),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The key of the tag.', example='key-1'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='value-1'),
    }
  ](name='TagsScope', description='The tag scope.'),
}

model UpdateConfigRuleShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.``', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.

For more information about how to query the ID of a rule, see [ListConfigRules](https://help.aliyun.com/document_detail/169607.html).

This parameter is required.', example='cr-a260626622af0005****'),
  configRuleName?: string(name='ConfigRuleName', description='The name of the rule.

For more information about how to query the name of a rule, see [ListAggregateConfigRules](https://help.aliyun.com/document_detail/264148.html).', example='The name of the rule.'),
  configRuleTriggerTypes?: string(name='ConfigRuleTriggerTypes', description='The trigger type of the rule. Valid values:

*   ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
*   ScheduledNotification: The rule is periodically triggered.

>  This parameter applies only to custom rules.', example='ConfigurationItemChangeNotification'),
  description?: string(name='Description', description='The description of the rule. You can enter up to 500 characters.', example='The description of the rule.'),
  excludeRegionIdsScope?: string(name='ExcludeRegionIdsScope', description='The IDs of the regions excluded from the compliance evaluations performed by the rule. Separate multiple region IDs with commas (,).', example='cn-shanghai'),
  excludeResourceGroupIdsScope?: string(name='ExcludeResourceGroupIdsScope', description='The IDs of the resource groups excluded from the compliance evaluations performed by the rule. Separate multiple resource group IDs with commas (,).', example='rg-bnczc6r7rml****'),
  excludeResourceIdsScope?: string(name='ExcludeResourceIdsScope', description='The IDs of the resources excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

>  This parameter applies only to a managed rule.', example='lb-t4nbowvtbkss7t326****'),
  excludeTagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The key of the tag.', example='key-2'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='value-2'),
    }
  ](name='ExcludeTagsScope', description='The scope of the tag that is excluded.'),
  extendContent?: string(name='ExtendContent', description='Optional. The extended content of the resource. This parameter can be used together with the MaximumExecutionFrequency parameter when the MaximumExecutionFrequency parameter is set to TwentyFour_Hours to specify the trigger time.', example='{"fixedHour":"12"}', nullable=true),
  inputParametersShrink?: string(name='InputParameters', description='The input parameters of the rule.', example='{"tag1Key":"ECS","tag1Value":"test"}'),
  maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The interval at which the rule is triggered. Valid values:

*   One_Hour
*   Three_Hours
*   Six_Hours
*   Twelve_Hours
*   TwentyFour_Hours (default)

>  This parameter is required if the `ConfigRuleTriggerTypes` parameter is set to `ScheduledNotification`.', example='One_Hour'),
  regionIdsScope?: string(name='RegionIdsScope', description='The IDs of the regions to which the rule applies. Separate multiple region IDs with commas (,).

>  This parameter applies only to a managed rule.', example='cn-hangzhou'),
  resourceGroupIdsScope?: string(name='ResourceGroupIdsScope', description='The IDs of the resource groups to which the rule applies. Separate multiple resource group IDs with commas (,).

>  This parameter applies only to a managed rule.', example='rg-aekzc7r7rhx****'),
  resourceIdsScope?: string(name='ResourceIdsScope', description='The IDs of the resources to which the rule applies. Separate multiple resource IDs with commas (,).', example='lb-5cmbowstbkss9ta03****'),
  resourceNameScope?: string(name='ResourceNameScope', description='The names of the resource to which the rule applies.', example='i-xxx', nullable=true),
  resourceTypesScopeShrink?: string(name='ResourceTypesScope', description='The type of the resource to be evaluated by the rule. Separate multiple resource types with commas (,).', example='ACS::ECS::Instance'),
  riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that do not comply with the rule. Valid values:

*   1: high
*   2: medium
*   3: low', example='3'),
  tagShrink?: string(name='Tag', description='The tags of the resource.

You can add up to 20 tags to a resource.'),
  tagKeyLogicScope?: string(name='TagKeyLogicScope', description='The logical relationship when parameter `TagsScope` takes multiple values, for example: When the parameter `TagsScope` is `"TagsScope.1.TagKey":"a", "TagsScope.1.TagValue":"a", "TagsScope.2.TagKey":"b", "TagsScope.2.TagValue":"b"`, if this parameter is set to` AND`, it means that the rule only applies to resources bound with both tags `a:a` and `b:b`. If not specified, the default logic is `OR`.

It can also be used for the deprecated field `TagKeyScope` (not recommended), for example: When the parameter `TagKeyScope` has a value of `ECS`,`OSS`, if this parameter is set to `AND`, it means that the rule only applies to resources bound with both labels `ECS` and `OSS`.

Values:

 - AND: And.

 - OR: Or.', example='AND'),
  tagKeyScope?: string(name='TagKeyScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag key used to filter resources. The rule applies only to the resources with the specified tag key.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='ECS', deprecated=true),
  tagValueScope?: string(name='TagValueScope', description='This parameter is deprecated. We recommend that you use the `TagsScope` parameter.

The tag value used to filter resources. The rule applies only to the resources that use the specified tag value.

>  This parameter applies only to a managed rule. You must configure the `TagKeyScope` and `TagValueScope` parameters at the same time.', example='test', deprecated=true),
  tagsScope?: [ 
    {
      tagKey?: string(name='TagKey', description='The key of the tag.', example='key-1'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='value-1'),
    }
  ](name='TagsScope', description='The tag scope.'),
}

model UpdateConfigRuleResponseBody = {
  configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-a260626622af0005****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6EC7AED1-172F-42AE-9C12-295BC2ADB751'),
}

model UpdateConfigRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateConfigRuleResponseBody(name='body'),
}

/**
 * @summary Modifies the description, input parameters, and risk level of a rule.
 *
 * @description This topic provides an example on how to change the risk level of the rule `cr-a260626622af0005****` to `3`, which indicates low risk level.
 *
 * @param tmpReq UpdateConfigRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateConfigRuleResponse
 */
async function updateConfigRuleWithOptions(tmpReq: UpdateConfigRuleRequest, runtime: Util.RuntimeOptions): UpdateConfigRuleResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateConfigRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.inputParameters)) {
    request.inputParametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.inputParameters, 'InputParameters', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceTypesScope)) {
    request.resourceTypesScopeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceTypesScope, 'ResourceTypesScope', 'simple');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configRuleId)) {
    body['ConfigRuleId'] = request.configRuleId;
  }
  if (!Util.isUnset(request.configRuleName)) {
    body['ConfigRuleName'] = request.configRuleName;
  }
  if (!Util.isUnset(request.configRuleTriggerTypes)) {
    body['ConfigRuleTriggerTypes'] = request.configRuleTriggerTypes;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.excludeRegionIdsScope)) {
    body['ExcludeRegionIdsScope'] = request.excludeRegionIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceGroupIdsScope)) {
    body['ExcludeResourceGroupIdsScope'] = request.excludeResourceGroupIdsScope;
  }
  if (!Util.isUnset(request.excludeResourceIdsScope)) {
    body['ExcludeResourceIdsScope'] = request.excludeResourceIdsScope;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.excludeTagsScope)) {
    bodyFlat['ExcludeTagsScope'] = request.excludeTagsScope;
  }
  if (!Util.isUnset(request.extendContent)) {
    body['ExtendContent'] = request.extendContent;
  }
  if (!Util.isUnset(request.inputParametersShrink)) {
    body['InputParameters'] = request.inputParametersShrink;
  }
  if (!Util.isUnset(request.maximumExecutionFrequency)) {
    body['MaximumExecutionFrequency'] = request.maximumExecutionFrequency;
  }
  if (!Util.isUnset(request.regionIdsScope)) {
    body['RegionIdsScope'] = request.regionIdsScope;
  }
  if (!Util.isUnset(request.resourceGroupIdsScope)) {
    body['ResourceGroupIdsScope'] = request.resourceGroupIdsScope;
  }
  if (!Util.isUnset(request.resourceIdsScope)) {
    body['ResourceIdsScope'] = request.resourceIdsScope;
  }
  if (!Util.isUnset(request.resourceNameScope)) {
    body['ResourceNameScope'] = request.resourceNameScope;
  }
  if (!Util.isUnset(request.resourceTypesScopeShrink)) {
    body['ResourceTypesScope'] = request.resourceTypesScopeShrink;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.tagKeyLogicScope)) {
    body['TagKeyLogicScope'] = request.tagKeyLogicScope;
  }
  if (!Util.isUnset(request.tagKeyScope)) {
    body['TagKeyScope'] = request.tagKeyScope;
  }
  if (!Util.isUnset(request.tagValueScope)) {
    body['TagValueScope'] = request.tagValueScope;
  }
  if (!Util.isUnset(request.tagsScope)) {
    bodyFlat['TagsScope'] = request.tagsScope;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateConfigRule',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the description, input parameters, and risk level of a rule.
 *
 * @description This topic provides an example on how to change the risk level of the rule `cr-a260626622af0005****` to `3`, which indicates low risk level.
 *
 * @param request UpdateConfigRuleRequest
 * @return UpdateConfigRuleResponse
 */
async function updateConfigRule(request: UpdateConfigRuleRequest): UpdateConfigRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateConfigRuleWithOptions(request, runtime);
}

model UpdateConfigurationRecorderRequest {
  resourceTypes?: string(name='ResourceTypes', description='The resource types. Separate multiple resource types with commas (,).

This parameter is required.', example='ACS::ECS::Instance'),
}

model UpdateConfigurationRecorderResponseBody = {
  configurationRecorder?: {
    configurationRecorderStatus?: string(name='ConfigurationRecorderStatus', description='The status of the configuration recorder. Valid values:

*   REGISTRABLE: The configuration recorder has not been registered.
*   BUILDING: The configuration recorder is being deployed.
*   REGISTERED: The configuration recorder has been registered.
*   REBUILDING: The configuration recorder is being redeployed.', example='REGISTERED'),
    resourceTypes?: [ string ](name='ResourceTypes', description='The types of the resources that are monitored by Cloud Config.'),
  }(name='ConfigurationRecorder', description='The details of the configuration recorder.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2A1D5095-D1F9-56B6-A712-EA495608E79A'),
}

model UpdateConfigurationRecorderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateConfigurationRecorderResponseBody(name='body'),
}

/**
 * @summary Modifies the resource monitoring scope of the current account.
 *
 * @description This topic provides an example on how to change the resource monitoring scope of the current account to ACS::ECS::Instance.
 *
 * @param request UpdateConfigurationRecorderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateConfigurationRecorderResponse
 */
async function updateConfigurationRecorderWithOptions(request: UpdateConfigurationRecorderRequest, runtime: Util.RuntimeOptions): UpdateConfigurationRecorderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.resourceTypes)) {
    body['ResourceTypes'] = request.resourceTypes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateConfigurationRecorder',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the resource monitoring scope of the current account.
 *
 * @description This topic provides an example on how to change the resource monitoring scope of the current account to ACS::ECS::Instance.
 *
 * @param request UpdateConfigurationRecorderRequest
 * @return UpdateConfigurationRecorderResponse
 */
async function updateConfigurationRecorder(request: UpdateConfigurationRecorderRequest): UpdateConfigurationRecorderResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateConfigurationRecorderWithOptions(request, runtime);
}

model UpdateDeliveryChannelRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests.

The `token` can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [Ensure idempotence](https://help.aliyun.com/document_detail/25693.html)', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
  configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Specifies whether to deliver resource change logs. If the value of this parameter is true, Cloud Config delivers the resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

*   true
*   false (default)

> This parameter is available for delivery channels of the OSS, Log Service, and MNS types.', example='false'),
  configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Specifies whether to deliver scheduled resource snapshots to the OSS bucket. If the value of this parameter is true, the scheduled resource snapshots are delivered to the specified OSS bucket at 00:00:00 and 12:00:00 on a daily basis. Valid values:

*   true
*   false (default)

> This parameter is applicable only to delivery channels of the OSS type.', example='false'),
  deliveryChannelAssumeRoleArn?: string(name='DeliveryChannelAssumeRoleArn', description='The ARN of the role that you want to assign to the delivery channel. Specify the ARN in the following format: `acs:ram::{accountId}:role/aliyunserviceroleforconfig`.', example='acs:ram::100931896542****:role/aliyunserviceroleforconfig'),
  deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule that is attached to the delivery channel. This parameter is available only for delivery channels of the MNS type.

This parameter specifies the lowest risk level and the resource types for the events to which you want to subscribe.

*   The setting of the lowest risk level for the events to which you want to subscribe is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.

    The `value` field specifies the lowest risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level. The value 2 indicates the medium risk level. The value 3 indicates the low risk level.

*   The setting of the resource types of the events to which you want to subscribe is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.

    The `values` field specifies the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Examples:

`[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.

For more information about how to obtain the ID of the delivery channel, see [DescribeDeliveryChannels](https://help.aliyun.com/document_detail/174466.html).

This parameter is required.', example='cdc-8e45ff4e06a3a8****'),
  deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.

> If you do not configure this parameter, this parameter is left empty.', example='testoss'),
  deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The ARN of the delivery destination. Valid values:

*   `acs:oss:{RegionId}:{accountId}:{bucketName}` if your delivery destination is an OSS bucket. Example: `acs:oss:cn-shanghai:100931896542****:new-bucket`.
*   `acs:mns:{RegionId}:{accountId}:/topics/{topicName}` if your delivery destination is an MNS topic. Example: `acs:mns:cn-shanghai:100931896542****:/topics/topic1`.
*   `acs:log:{RegionId}:{accountId}:project/{projectName}/logstore/{logstoreName}` if your delivery destination is a Log Service Logstore. Example: `acs:log:cn-shanghai:100931896542****:project/project1/logstore/logstore1`.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
  nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Specifies whether to deliver resource non-compliance events. If the value of this parameter is true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are evaluated as non-compliant. Valid values:

*   true
*   false (default)

> This parameter is available only for delivery channels of the Log Service or MNS type.', example='false'),
  oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel. Format: `acs:oss:{RegionId}:{accountId}:{bucketName}`.

If you do not configure this parameter, Cloud Config delivers only summary data.

> This parameter is available only for delivery channels of the Log Service or MNS type. The maximum storage size of delivery channels of the Log Service type is 1 MB, and the maximum storage size of delivery channels of the MNS type is 64 KB.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
  status?: long(name='Status', description='Specifies whether to enable the delivery channel. Valid values:

*   0: The delivery channel is disabled for Cloud Config. Cloud Config retains the most recent delivery configuration and stops resource data delivery.
*   1 (default): The delivery channel is enabled for Cloud Config.', example='0'),
}

model UpdateDeliveryChannelResponseBody = {
  deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-8e45ff4e06a3a8****'),
  requestId?: string(name='RequestId', description='The request ID.', example='A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG'),
}

model UpdateDeliveryChannelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDeliveryChannelResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI UpdateDeliveryChannel is deprecated, please use Config::2020-09-07::UpdateConfigDeliveryChannel,Config::2020-09-07::UpdateAggregateConfigDeliveryChannel instead.
 *
 * @summary Modifies a delivery channel.
 *
 * @description This topic provides an example on how to change the status of the delivery channel whose ID is `cdc-8e45ff4e06a3a8****` to 0, which indicates that the delivery channel is disabled. After the delivery channel is disabled, Cloud Config retains the last delivery configuration and stops resource data delivery.
 *
 * @param request UpdateDeliveryChannelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDeliveryChannelResponse
 */
// Deprecated
async function updateDeliveryChannelWithOptions(request: UpdateDeliveryChannelRequest, runtime: Util.RuntimeOptions): UpdateDeliveryChannelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configurationItemChangeNotification)) {
    body['ConfigurationItemChangeNotification'] = request.configurationItemChangeNotification;
  }
  if (!Util.isUnset(request.configurationSnapshot)) {
    body['ConfigurationSnapshot'] = request.configurationSnapshot;
  }
  if (!Util.isUnset(request.deliveryChannelAssumeRoleArn)) {
    body['DeliveryChannelAssumeRoleArn'] = request.deliveryChannelAssumeRoleArn;
  }
  if (!Util.isUnset(request.deliveryChannelCondition)) {
    body['DeliveryChannelCondition'] = request.deliveryChannelCondition;
  }
  if (!Util.isUnset(request.deliveryChannelId)) {
    body['DeliveryChannelId'] = request.deliveryChannelId;
  }
  if (!Util.isUnset(request.deliveryChannelName)) {
    body['DeliveryChannelName'] = request.deliveryChannelName;
  }
  if (!Util.isUnset(request.deliveryChannelTargetArn)) {
    body['DeliveryChannelTargetArn'] = request.deliveryChannelTargetArn;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.nonCompliantNotification)) {
    body['NonCompliantNotification'] = request.nonCompliantNotification;
  }
  if (!Util.isUnset(request.oversizedDataOSSTargetArn)) {
    body['OversizedDataOSSTargetArn'] = request.oversizedDataOSSTargetArn;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDeliveryChannel',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI UpdateDeliveryChannel is deprecated, please use Config::2020-09-07::UpdateConfigDeliveryChannel,Config::2020-09-07::UpdateAggregateConfigDeliveryChannel instead.
 *
 * @summary Modifies a delivery channel.
 *
 * @description This topic provides an example on how to change the status of the delivery channel whose ID is `cdc-8e45ff4e06a3a8****` to 0, which indicates that the delivery channel is disabled. After the delivery channel is disabled, Cloud Config retains the last delivery configuration and stops resource data delivery.
 *
 * @param request UpdateDeliveryChannelRequest
 * @return UpdateDeliveryChannelResponse
 */
// Deprecated
async function updateDeliveryChannel(request: UpdateDeliveryChannelRequest): UpdateDeliveryChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDeliveryChannelWithOptions(request, runtime);
}

model UpdateIntegratedServiceStatusRequest {
  aggregatorDeliveryDataType?: string(name='AggregatorDeliveryDataType', description='The type of the event that is integrated across accounts. Valid values:

*   NonCompliantNotification: non-compliance event', example='NonCompliantNotification'),
  integratedTypes?: string(name='IntegratedTypes', description='The types of the integrated events. Separate multiple event types with commas (,). Valid values:

*   ConfigurationItemChangeNotification: resource change event
*   NonCompliantNotification: non-compliance event', example='NonCompliantNotification'),
  serviceCode?: string(name='ServiceCode', description='The identity of the cloud service that is integrated with Cloud Config. Valid values:

*   eventbridge: EventBridge
*   cms: CloudMonitor
*   bpstudio: Cloud Architect Design Tools

This parameter is required.', example='cadt'),
  status?: boolean(name='Status', description='Specifies whether you want the product to be integrated. Valid values:

*   true
*   false

This parameter is required.', example='true'),
}

model UpdateIntegratedServiceStatusResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='02EB7638-B029-5ABB-93F5-A2ABEEAC282D'),
}

model UpdateIntegratedServiceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIntegratedServiceStatusResponseBody(name='body'),
}

/**
 * @summary Enables or disables the integration of a cloud service.
 *
 * @param request UpdateIntegratedServiceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIntegratedServiceStatusResponse
 */
async function updateIntegratedServiceStatusWithOptions(request: UpdateIntegratedServiceStatusRequest, runtime: Util.RuntimeOptions): UpdateIntegratedServiceStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregatorDeliveryDataType)) {
    body['AggregatorDeliveryDataType'] = request.aggregatorDeliveryDataType;
  }
  if (!Util.isUnset(request.integratedTypes)) {
    body['IntegratedTypes'] = request.integratedTypes;
  }
  if (!Util.isUnset(request.serviceCode)) {
    body['ServiceCode'] = request.serviceCode;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIntegratedServiceStatus',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables or disables the integration of a cloud service.
 *
 * @param request UpdateIntegratedServiceStatusRequest
 * @return UpdateIntegratedServiceStatusResponse
 */
async function updateIntegratedServiceStatus(request: UpdateIntegratedServiceStatusRequest): UpdateIntegratedServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIntegratedServiceStatusWithOptions(request, runtime);
}

model UpdateRemediationRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='2014295338-e7361358-5822-4276-8d30-b5183fac****'),
  invokeType?: string(name='InvokeType', description='The execution mode of the remediation. Valid values:

*   NON_EXECUTION: The remediation is not executed.
*   AUTO_EXECUTION: The remediation is automatically executed.
*   MANUAL_EXECUTION: The remediation is manually executed.
*   NOT_CONFIG: The execution mode is not specified.', example='AUTO_EXECUTION'),
  params?: string(name='Params', description='The desired parameter values of the remediation setting.', example='{"properties":[{"name":"regionId","type":"STRING","value":"{regionId}","allowedValues":[]},{"name":"bucketName","type":"STRING","value":"{resourceId}","allowedValues":[],"description":"OSS Bucket Name."},{"name":"permissionName","type":"STRING","value":"private","allowedValues":["public-read-write","public-read","private"],"description":"ACL Permission Name."}]}'),
  remediationId?: string(name='RemediationId', description='The ID of the remediation setting.

You can call the [ListRemediations](https://help.aliyun.com/document_detail/270772.html) operation to obtain the ID of the remediation setting.

This parameter is required.', example='crr-909ba2d4716700eb****'),
  remediationTemplateId?: string(name='RemediationTemplateId', description='The ID of the remediation template.

You can call the [ListRemediationTemplates](https://help.aliyun.com/document_detail/270066.html) operation to obtain the ID of the remediation template.', example='ACS-OSS-PutBucketAcl'),
  remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid values:

*   OOS: Operation Orchestration Service (OOS)
*   FC: Function Compute. You can use Function Compute to configure custom remediation settings.', example='OOS'),
  sourceType?: string(name='SourceType', description='The source of the remediation setting. Valid values:

*   ALIYUN: the default remediation setting of Alibaba Cloud.
*   CUSTOM: a custom remediation setting.
*   NONE: The source is not specified.', example='ALIYUN'),
}

model UpdateRemediationResponseBody = {
  remediationId?: string(name='RemediationId', description='The ID of the remediation setting.', example='crr-7c2ba2d0236700a3****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}

model UpdateRemediationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRemediationResponseBody(name='body'),
}

/**
 * @summary Updates a remediation template for a rule.
 *
 * @description This topic describes how to change the execution mode of the `crr-909ba2d4716700eb****` remediation setting to `AUTO_EXECUTION`, which specifies automatic remediation. This topic also provides a sample request.
 *
 * @param request UpdateRemediationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRemediationResponse
 */
async function updateRemediationWithOptions(request: UpdateRemediationRequest, runtime: Util.RuntimeOptions): UpdateRemediationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.invokeType)) {
    body['InvokeType'] = request.invokeType;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }
  if (!Util.isUnset(request.remediationId)) {
    body['RemediationId'] = request.remediationId;
  }
  if (!Util.isUnset(request.remediationTemplateId)) {
    body['RemediationTemplateId'] = request.remediationTemplateId;
  }
  if (!Util.isUnset(request.remediationType)) {
    body['RemediationType'] = request.remediationType;
  }
  if (!Util.isUnset(request.sourceType)) {
    body['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRemediation',
    version = '2020-09-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a remediation template for a rule.
 *
 * @description This topic describes how to change the execution mode of the `crr-909ba2d4716700eb****` remediation setting to `AUTO_EXECUTION`, which specifies automatic remediation. This topic also provides a sample request.
 *
 * @param request UpdateRemediationRequest
 * @return UpdateRemediationResponse
 */
async function updateRemediation(request: UpdateRemediationRequest): UpdateRemediationResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRemediationWithOptions(request, runtime);
}

